diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8c982c5d4d..94dbb9e623 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -310,6 +310,13 @@ jobs: -P enable-integration-tests \ --batch-mode \ --no-transfer-progress + - name: Showcase integration tests - Protobuf gen code 3.21.0 + working-directory: java-showcase-3.21.0 + run: | + mvn verify \ + -P enable-integration-tests \ + --batch-mode \ + --no-transfer-progress showcase: runs-on: ubuntu-22.04 strategy: diff --git a/java-showcase-3.21.0/README.md b/java-showcase-3.21.0/README.md new file mode 100644 index 0000000000..736f5d1cf0 --- /dev/null +++ b/java-showcase-3.21.0/README.md @@ -0,0 +1,2 @@ +This is a copy of [GAPIC Showcase](https://github.com/googleapis/gapic-showcase) with protobuf 3.21.0 gen code. +This is intended to test the compatibility between protobuf-java runtime v4.33.0 and gen code 3.21.0. \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase-extended/proto/BUILD.bazel b/java-showcase-3.21.0/gapic-showcase-extended/proto/BUILD.bazel new file mode 100644 index 0000000000..bc57596d1b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase-extended/proto/BUILD.bazel @@ -0,0 +1,34 @@ +# Copyright 2023 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" +Provides proto_library target +Exports grpc service config +""" +load ("@rules_proto//proto:defs.bzl", "proto_library") + +# This is an API workspace, having public visibility by default makes perfect sense. +package(default_visibility = ["//visibility:public"]) + +# This BUILD file is the framework for gapic-showcase-extended (an extension to the existing gapic-showcase) +# It serves to augment the existing showcase project with generic protos not *yet* suited to the upstream project +# +# gapic-showcase project is used to test the generated client behavior with a showcase server +# gapic-showcase-extension project is used to test the generator's behavior + +#proto_library( +# name = "showcase_proto_extended", +# srcs = [], +# deps = [] +#) \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase-extended/proto/wicked.proto b/java-showcase-3.21.0/gapic-showcase-extended/proto/wicked.proto new file mode 100644 index 0000000000..ea45fee918 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase-extended/proto/wicked.proto @@ -0,0 +1,49 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// This service is used to show a Service with either non-enabled or non-eligible +// RPCs for HttpJson (Http 1.1). +// Non-Enabled: Missing the (google.api.http) annotation to enabled it +// Non-Eligible: BIDI and Client side streaming are not supported with Http 1.1 +// Service name is reference to `No REST for the Wicked` +service Wicked { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + rpc CraftEvilPlan(EvilRequest) returns (EvilResponse); + + rpc BrainstormEvilPlans(stream EvilRequest) returns (stream EvilResponse); + + rpc PersuadeEvilPlan(stream EvilRequest) returns (EvilResponse); +} + +message EvilRequest { + string malicious_idea = 1; +} + +message EvilResponse { + string malicious_plan = 1; +} \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/pom.xml b/java-showcase-3.21.0/gapic-showcase/pom.xml new file mode 100644 index 0000000000..a9e4de22fe --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/pom.xml @@ -0,0 +1,366 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + 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.1-SNAPSHOT + + + + 0.36.2 + + 1.2.13 + 1.5.21 + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.13 + + + report + + report + + + + XML + HTML + + + + + + + com.spotify.fmt + fmt-maven-plugin + 2.25 + + (IT.*\.java)|(.*Test.java)|(TestClientInitializer.java) + + + + com.googlecode.maven-download-plugin + download-maven-plugin + 1.6.8 + + + download-compliance-suite + generate-test-resources + + wget + + + + https://raw.githubusercontent.com/googleapis/gapic-showcase/v${gapic-showcase.version}/server/services/compliance_suite.json + + src/test/resources + + true + + + + + + + + + + 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 + grpc-google-common-protos + test + + + 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.junit.jupiter + junit-jupiter-engine + test + + + org.junit.vintage + junit-vintage-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + com.google.truth + truth + 1.4.4 + + + junit + junit + + + test + + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + test + + + + com.google.api + gax + test-jar + testlib + test + + + com.google.api + gax-grpc + test-jar + testlib + test + + + com.google.api + gax-httpjson + test-jar + testlib + test + + + com.google.auth + google-auth-library-oauth2-http + test-jar + testlib + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + + + io.opentelemetry + opentelemetry-api + test + + + io.opentelemetry + opentelemetry-sdk + test + + + io.opentelemetry + opentelemetry-sdk-testing + test + + + + io.grpc + grpc-opentelemetry + test + + + + + + + + slf4j2_logback + + + + slf4j2_logback + + + + + org.slf4j + slf4j-api + 2.0.16 + test + + + ch.qos.logback + logback-classic + ${slf4j2-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j2-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + + + + + + + + slf4j1_logback + + + + slf4j1_logback + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + disabledLogging + + + + + disable_logging + + + + + org.slf4j + slf4j-api + 1.7.36 + test + + + ch.qos.logback + logback-classic + ${slf4j1-logback.version} + test + + + ch.qos.logback + logback-core + ${slf4j1-logback.version} + test + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + **/com/google/showcase/v1beta1/it/*.java + **/com/google/showcase/v1beta1/it/logging/ITLogging1x.java + **/com/google/showcase/v1beta1/it/logging/ITLogging.java + + + + + + + + + diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java new file mode 100644 index 0000000000..2bd2776fd9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -0,0 +1,1595 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.stub.ComplianceStub; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import java.io.IOException; +import java.util.List; +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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

RepeatDataBody

This method echoes the ComplianceData request. This method exercises sending the entire request object in the REST body.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataBody(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataBodyCallable() + *

+ *

RepeatDataBodyInfo

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataBodyInfo(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataBodyInfoCallable() + *

+ *

RepeatDataQuery

This method echoes the ComplianceData request. This method exercises sending all request fields as query parameters.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataQuery(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataQueryCallable() + *

+ *

RepeatDataSimplePath

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataSimplePath(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataSimplePathCallable() + *

+ *

RepeatDataPathResource

Same as RepeatDataSimplePath, but with a path resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataPathResource(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataPathResourceCallable() + *

+ *

RepeatDataPathTrailingResource

Same as RepeatDataSimplePath, but with a trailing resource.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataPathTrailingResource(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataPathTrailingResourceCallable() + *

+ *

RepeatDataBodyPut

This method echoes the ComplianceData request, using the HTTP PUT method.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataBodyPut(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataBodyPutCallable() + *

+ *

RepeatDataBodyPatch

This method echoes the ComplianceData request, using the HTTP PATCH method.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • repeatDataBodyPatch(RepeatRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • repeatDataBodyPatchCallable() + *

+ *

GetEnum

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 values 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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getEnum(EnumRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getEnumCallable() + *

+ *

VerifyEnum

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • verifyEnum(EnumResponse request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • verifyEnumCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

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 values + * 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 values + * 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : complianceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = complianceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = complianceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = complianceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = complianceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = complianceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = complianceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = complianceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = complianceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java new file mode 100644 index 0000000000..b96f3fcdbe --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -0,0 +1,373 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * ComplianceSettings complianceSettings = complianceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((ComplianceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((ComplianceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((ComplianceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((ComplianceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + 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(); + } + + 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. */ + 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()); + } + + 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(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public ComplianceSettings build() throws IOException { + return new ComplianceSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java new file mode 100644 index 0000000000..5f0a0b0a3d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -0,0 +1,1781 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.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")
+ *           .setRequestId("requestId693933066")
+ *           .setOtherRequestId("otherRequestId1248995034")
+ *           .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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

Echo

This method simply echoes the request. This method showcases unary RPCs.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • echo(EchoRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • echoCallable() + *

+ *

EchoErrorDetails

This method returns error details in a repeated "google.protobuf.Any" field. This method showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at run-time, the actual types for these fields must be one of the types in google/rpc/error_details.proto.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • echoErrorDetails(EchoErrorDetailsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • echoErrorDetailsCallable() + *

+ *

FailEchoWithDetails

This method always fails with a gRPC "Aborted" error status that contains multiple error details. These include one instance of each of the standard ones in error_details.proto (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can process these various error details and surface them to the user in an idiomatic form.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • failEchoWithDetails(FailEchoWithDetailsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • failEchoWithDetailsCallable() + *

+ *

Expand

This method splits the given content into words and will pass each word back through the stream. This method showcases server-side streaming RPCs.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • expandCallable() + *

+ *

Collect

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.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • collectCallable() + *

+ *

Chat

This method, upon receiving a request on the stream, will pass the same content back on the stream. This method showcases bidirectional streaming RPCs.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • chatCallable() + *

+ *

PagedExpand

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • pagedExpand(PagedExpandRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • pagedExpandPagedCallable() + *

  • pagedExpandCallable() + *

+ *

PagedExpandLegacy

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • pagedExpandLegacy(PagedExpandLegacyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • pagedExpandLegacyCallable() + *

+ *

PagedExpandLegacyMapped

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • pagedExpandLegacyMapped(PagedExpandRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • pagedExpandLegacyMappedPagedCallable() + *

  • pagedExpandLegacyMappedCallable() + *

+ *

Wait

This method will wait for the requested amount of time and then return. This method showcases how a client handles a request timeout.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • waitAsync(WaitRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • waitOperationCallable() + *

  • waitCallable() + *

+ *

Block

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • block(BlockRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • blockCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

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")
+   *           .setRequestId("requestId693933066")
+   *           .setOtherRequestId("otherRequestId1248995034")
+   *           .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")
+   *           .setRequestId("requestId693933066")
+   *           .setOtherRequestId("otherRequestId1248995034")
+   *           .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 returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   EchoErrorDetailsRequest request =
+   *       EchoErrorDetailsRequest.newBuilder()
+   *           .setSingleDetailText("singleDetailText1774380934")
+   *           .addAllMultiDetailText(new ArrayList())
+   *           .build();
+   *   EchoErrorDetailsResponse response = echoClient.echoErrorDetails(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 EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest request) { + return echoErrorDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method returns error details in a repeated "google.protobuf.Any" field. This method + * showcases handling errors thus encoded, particularly over REST transport. Note that GAPICs only + * allow the type "google.protobuf.Any" for field paths ending in "error.details", and, at + * run-time, the actual types for these fields must be one of the types in + * google/rpc/error_details.proto. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   EchoErrorDetailsRequest request =
+   *       EchoErrorDetailsRequest.newBuilder()
+   *           .setSingleDetailText("singleDetailText1774380934")
+   *           .addAllMultiDetailText(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       echoClient.echoErrorDetailsCallable().futureCall(request);
+   *   // Do something.
+   *   EchoErrorDetailsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + echoErrorDetailsCallable() { + return stub.echoErrorDetailsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   FailEchoWithDetailsRequest request =
+   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
+   *   FailEchoWithDetailsResponse response = echoClient.failEchoWithDetails(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 FailEchoWithDetailsResponse failEchoWithDetails(FailEchoWithDetailsRequest request) { + return failEchoWithDetailsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method always fails with a gRPC "Aborted" error status that contains multiple error + * details. These include one instance of each of the standard ones in error_details.proto + * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) plus a + * custom, Showcase-defined PoetryError. The intent of this RPC is to verify that GAPICs can + * process these various error details and surface them to the user in an idiomatic form. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   FailEchoWithDetailsRequest request =
+   *       FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build();
+   *   ApiFuture future =
+   *       echoClient.failEchoWithDetailsCallable().futureCall(request);
+   *   // Do something.
+   *   FailEchoWithDetailsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + failEchoWithDetailsCallable() { + return stub.failEchoWithDetailsCallable(); + } + + // 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())
+   *           .setStreamWaitTime(Duration.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")
+   *           .setRequestId("requestId693933066")
+   *           .setOtherRequestId("otherRequestId1248995034")
+   *           .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")
+   *           .setRequestId("requestId693933066")
+   *           .setOtherRequestId("otherRequestId1248995034")
+   *           .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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : echoClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = echoClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = echoClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = echoClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = echoClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = echoClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = echoClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = echoClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = echoClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = echoClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       echoClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class 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); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java new file mode 100644 index 0000000000..41ab2f8e20 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -0,0 +1,438 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * EchoSettings echoSettings = echoSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .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 echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).echoErrorDetailsSettings(); + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return ((EchoStubSettings) getStubSettings()).failEchoWithDetailsSettings(); + } + + /** 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(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((EchoStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((EchoStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((EchoStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((EchoStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + 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(); + } + + 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. */ + 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()); + } + + 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 echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return getStubSettingsBuilder().echoErrorDetailsSettings(); + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return getStubSettingsBuilder().failEchoWithDetailsSettings(); + } + + /** 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(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public EchoSettings build() throws IOException { + return new EchoSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java new file mode 100644 index 0000000000..fbf33c1089 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentityClient.java @@ -0,0 +1,1358 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateUser

Creates a user.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createUser(CreateUserRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createUser(String displayName, String email) + *

  • createUser(String displayName, String email, int age, String nickname, boolean enableNotifications, double heightFeet) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createUserCallable() + *

+ *

GetUser

Retrieves the User with the given uri.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getUser(GetUserRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getUser(UserName name) + *

  • getUser(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getUserCallable() + *

+ *

UpdateUser

Updates a user.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateUser(UpdateUserRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateUserCallable() + *

+ *

DeleteUser

Deletes a user, their profile, and all of their authored messages.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteUser(DeleteUserRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteUser(UserName name) + *

  • deleteUser(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteUserCallable() + *

+ *

ListUsers

Lists all users.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listUsers(ListUsersRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listUsersPagedCallable() + *

  • listUsersCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : identityClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = identityClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = identityClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = identityClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = identityClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = identityClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = identityClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = identityClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = identityClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = identityClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       identityClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class 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); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java new file mode 100644 index 0000000000..eb2dae0ce1 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/IdentitySettings.java @@ -0,0 +1,325 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createUser: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * IdentitySettings identitySettings = identitySettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((IdentityStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((IdentityStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((IdentityStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((IdentityStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + 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(); + } + + 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. */ + 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()); + } + + 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(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public IdentitySettings build() throws IOException { + return new IdentitySettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java new file mode 100644 index 0000000000..b5bfc0bb2a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -0,0 +1,2853 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateRoom

Creates a room.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createRoom(CreateRoomRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createRoom(String displayName, String description) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createRoomCallable() + *

+ *

GetRoom

Retrieves the Room with the given resource name.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getRoom(GetRoomRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getRoom(RoomName name) + *

  • getRoom(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getRoomCallable() + *

+ *

UpdateRoom

Updates a room.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateRoom(UpdateRoomRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateRoomCallable() + *

+ *

DeleteRoom

Deletes a room and all of its blurbs.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteRoom(DeleteRoomRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteRoom(RoomName name) + *

  • deleteRoom(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteRoomCallable() + *

+ *

ListRooms

Lists all chat rooms.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listRooms(ListRoomsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listRoomsPagedCallable() + *

  • listRoomsCallable() + *

+ *

CreateBlurb

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createBlurb(CreateBlurbRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createBlurb(ProfileName parent, UserName user, ByteString image) + *

  • createBlurb(ProfileName parent, UserName user, String text) + *

  • createBlurb(ProfileName parent, String user, ByteString image) + *

  • createBlurb(ProfileName parent, String user, String text) + *

  • createBlurb(RoomName parent, UserName user, ByteString image) + *

  • createBlurb(RoomName parent, UserName user, String text) + *

  • createBlurb(RoomName parent, String user, ByteString image) + *

  • createBlurb(RoomName parent, String user, String text) + *

  • createBlurb(String parent, UserName user, ByteString image) + *

  • createBlurb(String parent, UserName user, String text) + *

  • createBlurb(String parent, String user, ByteString image) + *

  • createBlurb(String parent, String user, String text) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createBlurbCallable() + *

+ *

GetBlurb

Retrieves the Blurb with the given resource name.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getBlurb(GetBlurbRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getBlurb(BlurbName name) + *

  • getBlurb(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getBlurbCallable() + *

+ *

UpdateBlurb

Updates a blurb.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateBlurb(UpdateBlurbRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateBlurbCallable() + *

+ *

DeleteBlurb

Deletes a blurb.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteBlurb(DeleteBlurbRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • deleteBlurb(BlurbName name) + *

  • deleteBlurb(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteBlurbCallable() + *

+ *

ListBlurbs

Lists blurbs for a specific chat room or user profile depending on the parent resource name.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listBlurbs(ListBlurbsRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listBlurbs(ProfileName parent) + *

  • listBlurbs(RoomName parent) + *

  • listBlurbs(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listBlurbsPagedCallable() + *

  • listBlurbsCallable() + *

+ *

SearchBlurbs

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • searchBlurbsAsync(SearchBlurbsRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • searchBlurbsAsync(ProfileName parent, String query) + *

  • searchBlurbsAsync(RoomName parent, String query) + *

  • searchBlurbsAsync(String parent, String query) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • searchBlurbsOperationCallable() + *

  • searchBlurbsCallable() + *

+ *

StreamBlurbs

This returns a stream that emits the blurbs that are created for a particular chat room or user profile.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • streamBlurbsCallable() + *

+ *

SendBlurbs

This is a stream to create multiple blurbs. If an invalid blurb is requested to be created, the stream will close with an error.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • sendBlurbsCallable() + *

+ *

Connect

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.

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • connectCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

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 who 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 who 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 who 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : messagingClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = messagingClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = messagingClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = messagingClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = messagingClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = messagingClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = messagingClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = messagingClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = messagingClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = messagingClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       messagingClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class 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); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java new file mode 100644 index 0000000000..377a43a4c4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingSettings.java @@ -0,0 +1,463 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createRoom: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MessagingSettings messagingSettings = messagingSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for searchBlurbs: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * messagingSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .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(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MessagingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MessagingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((MessagingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((MessagingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + 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(); + } + + 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. */ + 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()); + } + + 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(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public MessagingSettings build() throws IOException { + return new MessagingSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java new file mode 100644 index 0000000000..76ac609f2d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -0,0 +1,1342 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.stub.SequenceServiceStub; +import com.google.showcase.v1beta1.stub.SequenceServiceStubSettings; +import java.io.IOException; +import java.util.List; +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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateSequence

Creates a sequence.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSequence(CreateSequenceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createSequence(Sequence sequence) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSequenceCallable() + *

+ *

CreateStreamingSequence

Creates a sequence.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createStreamingSequence(CreateStreamingSequenceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • createStreamingSequence(StreamingSequence streamingSequence) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createStreamingSequenceCallable() + *

+ *

GetSequenceReport

Retrieves a sequence.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSequenceReport(GetSequenceReportRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getSequenceReport(SequenceReportName name) + *

  • getSequenceReport(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSequenceReportCallable() + *

+ *

GetStreamingSequenceReport

Retrieves a sequence.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getStreamingSequenceReport(GetStreamingSequenceReportRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getStreamingSequenceReport(StreamingSequenceReportName name) + *

  • getStreamingSequenceReport(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getStreamingSequenceReportCallable() + *

+ *

AttemptSequence

Attempts a sequence.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • attemptSequence(AttemptSequenceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • attemptSequence(SequenceName name) + *

  • attemptSequence(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • attemptSequenceCallable() + *

+ *

AttemptStreamingSequence

Attempts a streaming sequence. May not function as expected in HTTP mode due to when http statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • attemptStreamingSequenceCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

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. + /** + * 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()) {
+   *   StreamingSequence streamingSequence = StreamingSequence.newBuilder().build();
+   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(streamingSequence);
+   * }
+   * }
+ * + * @param streamingSequence + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequence createStreamingSequence(StreamingSequence streamingSequence) { + CreateStreamingSequenceRequest request = + CreateStreamingSequenceRequest.newBuilder().setStreamingSequence(streamingSequence).build(); + return createStreamingSequence(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()) {
+   *   CreateStreamingSequenceRequest request =
+   *       CreateStreamingSequenceRequest.newBuilder()
+   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
+   *           .build();
+   *   StreamingSequence response = sequenceServiceClient.createStreamingSequence(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 StreamingSequence createStreamingSequence(CreateStreamingSequenceRequest request) { + return createStreamingSequenceCallable().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()) {
+   *   CreateStreamingSequenceRequest request =
+   *       CreateStreamingSequenceRequest.newBuilder()
+   *           .setStreamingSequence(StreamingSequence.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       sequenceServiceClient.createStreamingSequenceCallable().futureCall(request);
+   *   // Do something.
+   *   StreamingSequence response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + createStreamingSequenceCallable() { + return stub.createStreamingSequenceCallable(); + } + + // 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. + /** + * 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()) {
+   *   StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]");
+   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
+   * }
+   * }
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport( + StreamingSequenceReportName name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getStreamingSequenceReport(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 = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString();
+   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(name);
+   * }
+   * }
+ * + * @param name + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final StreamingSequenceReport getStreamingSequenceReport(String name) { + GetStreamingSequenceReportRequest request = + GetStreamingSequenceReportRequest.newBuilder().setName(name).build(); + return getStreamingSequenceReport(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()) {
+   *   GetStreamingSequenceReportRequest request =
+   *       GetStreamingSequenceReportRequest.newBuilder()
+   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
+   *           .build();
+   *   StreamingSequenceReport response = sequenceServiceClient.getStreamingSequenceReport(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 StreamingSequenceReport getStreamingSequenceReport( + GetStreamingSequenceReportRequest request) { + return getStreamingSequenceReportCallable().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()) {
+   *   GetStreamingSequenceReportRequest request =
+   *       GetStreamingSequenceReportRequest.newBuilder()
+   *           .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       sequenceServiceClient.getStreamingSequenceReportCallable().futureCall(request);
+   *   // Do something.
+   *   StreamingSequenceReport response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getStreamingSequenceReportCallable() { + return stub.getStreamingSequenceReportCallable(); + } + + // 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Attempts a streaming sequence. May not function as expected in HTTP mode due to when http + * statuses are sent See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   AttemptStreamingSequenceRequest request =
+   *       AttemptStreamingSequenceRequest.newBuilder()
+   *           .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString())
+   *           .setLastFailIndex(2006482362)
+   *           .build();
+   *   ServerStream stream =
+   *       sequenceServiceClient.attemptStreamingSequenceCallable().call(request);
+   *   for (AttemptStreamingSequenceResponse response : stream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable() { + return stub.attemptStreamingSequenceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : sequenceServiceClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       sequenceServiceClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         sequenceServiceClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = sequenceServiceClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = sequenceServiceClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = sequenceServiceClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sequenceServiceClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = sequenceServiceClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = sequenceServiceClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = sequenceServiceClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       sequenceServiceClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java new file mode 100644 index 0000000000..67eefab806 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceSettings.java @@ -0,0 +1,344 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSequence: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * SequenceServiceSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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 createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).createStreamingSequenceSettings(); + } + + /** 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 getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getStreamingSequenceReportSettings(); + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptSequenceSettings(); + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).attemptStreamingSequenceSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((SequenceServiceStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((SequenceServiceStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + 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(); + } + + 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. */ + 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()); + } + + 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 createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return getStubSettingsBuilder().createStreamingSequenceSettings(); + } + + /** 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 getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStubSettingsBuilder().getStreamingSequenceReportSettings(); + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return getStubSettingsBuilder().attemptSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return getStubSettingsBuilder().attemptStreamingSequenceSettings(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public SequenceServiceSettings build() throws IOException { + return new SequenceServiceSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java new file mode 100644 index 0000000000..517fd7f7d3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingClient.java @@ -0,0 +1,1501 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

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(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

CreateSession

Creates a new testing session. Adding this comment with special characters for comment formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*`

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createSession(CreateSessionRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createSessionCallable() + *

+ *

GetSession

Gets a testing session.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getSession(GetSessionRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getSessionCallable() + *

+ *

ListSessions

Lists the current test sessions.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listSessions(ListSessionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listSessionsPagedCallable() + *

  • listSessionsCallable() + *

+ *

DeleteSession

Delete a test session.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteSession(DeleteSessionRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteSessionCallable() + *

+ *

ReportSession

Report on the status of a session. This generates a report detailing which tests have been completed, and an overall rollup.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • reportSession(ReportSessionRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • reportSessionCallable() + *

+ *

ListTests

List the tests of a sessesion.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listTests(ListTestsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listTestsPagedCallable() + *

  • listTestsCallable() + *

+ *

DeleteTest

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteTest(DeleteTestRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteTestCallable() + *

+ *

VerifyTest

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.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • verifyTest(VerifyTestRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • verifyTestCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *

SetIamPolicy

Sets the access control policy on the specified resource. Replaces any existing policy. + *

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

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • setIamPolicy(SetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • setIamPolicyCallable() + *

+ *

GetIamPolicy

Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getIamPolicy(GetIamPolicyRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getIamPolicyCallable() + *

+ *

TestIamPermissions

Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + *

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • testIamPermissions(TestIamPermissionsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • testIamPermissionsCallable() + *

+ *
+ * + *

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. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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. Adding this comment with special characters for comment + * formatting tests: 1. (abra->kadabra->alakazam) 2) [Nonsense][]: + * `pokemon/*/psychic/*` + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : testingClient.listLocations(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future = testingClient.listLocationsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Location element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listLocationsPagedCallable() { + return stub.listLocationsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = testingClient.listLocationsCallable().call(request);
+   *     for (Location element : response.getLocationsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listLocationsCallable() { + return stub.listLocationsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = testingClient.getLocation(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = testingClient.getLocationCallable().futureCall(request);
+   *   // Do something.
+   *   Location response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getLocationCallable() { + return stub.getLocationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   Policy response = testingClient.setIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy setIamPolicy(SetIamPolicyRequest request) { + return setIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Sets the access control policy on the specified resource. Replaces any existing policy. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   SetIamPolicyRequest request =
+   *       SetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setPolicy(Policy.newBuilder().build())
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = testingClient.setIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable setIamPolicyCallable() { + return stub.setIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   Policy response = testingClient.getIamPolicy(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Policy getIamPolicy(GetIamPolicyRequest request) { + return getIamPolicyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the access control policy for a resource. Returns an empty policy if the resource exists + * and does not have a policy set. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   GetIamPolicyRequest request =
+   *       GetIamPolicyRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .setOptions(GetPolicyOptions.newBuilder().build())
+   *           .build();
+   *   ApiFuture future = testingClient.getIamPolicyCallable().futureCall(request);
+   *   // Do something.
+   *   Policy response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getIamPolicyCallable() { + return stub.getIamPolicyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   TestIamPermissionsResponse response = testingClient.testIamPermissions(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) { + return testIamPermissionsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns permissions that a caller has on the specified resource. If the resource does not + * exist, this will return an empty set of permissions, not a `NOT_FOUND` error. + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying 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()) {
+   *   TestIamPermissionsRequest request =
+   *       TestIamPermissionsRequest.newBuilder()
+   *           .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString())
+   *           .addAllPermissions(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       testingClient.testIamPermissionsCallable().futureCall(request);
+   *   // Do something.
+   *   TestIamPermissionsResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + testIamPermissionsCallable() { + return stub.testIamPermissionsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class 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); + } + } + + public static class ListLocationsPagedResponse + extends AbstractPagedListResponse< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListLocationsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListLocationsPagedResponse(ListLocationsPage page) { + super(page, ListLocationsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListLocationsPage + extends AbstractPage< + ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> { + + private ListLocationsPage( + PageContext context, + ListLocationsResponse response) { + super(context, response); + } + + private static ListLocationsPage createEmptyPage() { + return new ListLocationsPage(null, null); + } + + @Override + protected ListLocationsPage createPage( + PageContext context, + ListLocationsResponse response) { + return new ListLocationsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListLocationsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListLocationsRequest, + ListLocationsResponse, + Location, + ListLocationsPage, + ListLocationsFixedSizeCollection> { + + private ListLocationsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListLocationsFixedSizeCollection createEmptyCollection() { + return new ListLocationsFixedSizeCollection(null, 0); + } + + @Override + protected ListLocationsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListLocationsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java new file mode 100644 index 0000000000..df199941fe --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/TestingSettings.java @@ -0,0 +1,360 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSession: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * TestingSettings testingSettings = testingSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((TestingStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((TestingStubSettings) getStubSettings()).getLocationSettings(); + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).setIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return ((TestingStubSettings) getStubSettings()).getIamPolicySettings(); + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return ((TestingStubSettings) getStubSettings()).testIamPermissionsSettings(); + } + + 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(); + } + + 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. */ + 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()); + } + + 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(); + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return getStubSettingsBuilder().listLocationsSettings(); + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getStubSettingsBuilder().getLocationSettings(); + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return getStubSettingsBuilder().setIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getStubSettingsBuilder().getIamPolicySettings(); + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return getStubSettingsBuilder().testIamPermissionsSettings(); + } + + @Override + public TestingSettings build() throws IOException { + return new TestingSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json new file mode 100644 index 0000000000..4d11ed39b9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json @@ -0,0 +1,316 @@ +{ + "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"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "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"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyEnum": { + "methods": ["verifyEnum", "verifyEnumCallable"] + } + } + } + } + }, + "Echo": { + "clients": { + "grpc": { + "libraryClient": "EchoClient", + "rpcs": { + "Block": { + "methods": ["block", "blockCallable"] + }, + "Chat": { + "methods": ["chatCallable"] + }, + "Collect": { + "methods": ["collectCallable"] + }, + "Echo": { + "methods": ["echo", "echoCallable"] + }, + "EchoErrorDetails": { + "methods": ["echoErrorDetails", "echoErrorDetailsCallable"] + }, + "Expand": { + "methods": ["expandCallable"] + }, + "FailEchoWithDetails": { + "methods": ["failEchoWithDetails", "failEchoWithDetailsCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "PagedExpand": { + "methods": ["pagedExpand", "pagedExpandPagedCallable", "pagedExpandCallable"] + }, + "PagedExpandLegacy": { + "methods": ["pagedExpandLegacy", "pagedExpandLegacyCallable"] + }, + "PagedExpandLegacyMapped": { + "methods": ["pagedExpandLegacyMapped", "pagedExpandLegacyMappedPagedCallable", "pagedExpandLegacyMappedCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "Wait": { + "methods": ["waitAsync", "waitOperationCallable", "waitCallable"] + } + } + } + }, + "apiVersion": "v1_20240408" + }, + "Identity": { + "clients": { + "grpc": { + "libraryClient": "IdentityClient", + "rpcs": { + "CreateUser": { + "methods": ["createUser", "createUser", "createUser", "createUserCallable"] + }, + "DeleteUser": { + "methods": ["deleteUser", "deleteUser", "deleteUser", "deleteUserCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetUser": { + "methods": ["getUser", "getUser", "getUser", "getUserCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListUsers": { + "methods": ["listUsers", "listUsersPagedCallable", "listUsersCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "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"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetRoom": { + "methods": ["getRoom", "getRoom", "getRoom", "getRoomCallable"] + }, + "ListBlurbs": { + "methods": ["listBlurbs", "listBlurbs", "listBlurbs", "listBlurbs", "listBlurbsPagedCallable", "listBlurbsCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListRooms": { + "methods": ["listRooms", "listRoomsPagedCallable", "listRoomsCallable"] + }, + "SearchBlurbs": { + "methods": ["searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsAsync", "searchBlurbsOperationCallable", "searchBlurbsCallable"] + }, + "SendBlurbs": { + "methods": ["sendBlurbsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "StreamBlurbs": { + "methods": ["streamBlurbsCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateBlurb": { + "methods": ["updateBlurb", "updateBlurbCallable"] + }, + "UpdateRoom": { + "methods": ["updateRoom", "updateRoomCallable"] + } + } + } + } + }, + "SequenceService": { + "clients": { + "grpc": { + "libraryClient": "SequenceServiceClient", + "rpcs": { + "AttemptSequence": { + "methods": ["attemptSequence", "attemptSequence", "attemptSequence", "attemptSequenceCallable"] + }, + "AttemptStreamingSequence": { + "methods": ["attemptStreamingSequenceCallable"] + }, + "CreateSequence": { + "methods": ["createSequence", "createSequence", "createSequenceCallable"] + }, + "CreateStreamingSequence": { + "methods": ["createStreamingSequence", "createStreamingSequence", "createStreamingSequenceCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSequenceReport": { + "methods": ["getSequenceReport", "getSequenceReport", "getSequenceReport", "getSequenceReportCallable"] + }, + "GetStreamingSequenceReport": { + "methods": ["getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReport", "getStreamingSequenceReportCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + } + } + } + } + }, + "Testing": { + "clients": { + "grpc": { + "libraryClient": "TestingClient", + "rpcs": { + "CreateSession": { + "methods": ["createSession", "createSessionCallable"] + }, + "DeleteSession": { + "methods": ["deleteSession", "deleteSessionCallable"] + }, + "DeleteTest": { + "methods": ["deleteTest", "deleteTestCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicyCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "GetSession": { + "methods": ["getSession", "getSessionCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "ListSessions": { + "methods": ["listSessions", "listSessionsPagedCallable", "listSessionsCallable"] + }, + "ListTests": { + "methods": ["listTests", "listTestsPagedCallable", "listTestsCallable"] + }, + "ReportSession": { + "methods": ["reportSession", "reportSessionCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissionsCallable"] + }, + "VerifyTest": { + "methods": ["verifyTest", "verifyTestCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java new file mode 100644 index 0000000000..56f2990a66 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/package-info.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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")
+ *           .setRequestId("requestId693933066")
+ *           .setOtherRequestId("otherRequestId1248995034")
+ *           .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. + * Adding this comment with special characters for comment formatting tests: 1. + * (abra->kadabra->alakazam) 2) [Nonsense][]: `pokemon/*/psychic/*` + * + *

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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java new file mode 100644 index 0000000000..3597a8d360 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java @@ -0,0 +1,118 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java new file mode 100644 index 0000000000..ad7ae867bf --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -0,0 +1,727 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of repeatDataBody: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * ComplianceStubSettings complianceSettings = complianceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to 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; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(ComplianceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + 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(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().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 final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + 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(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + 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(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + repeatDataBodySettings, + repeatDataBodyInfoSettings, + repeatDataQuerySettings, + repeatDataSimplePathSettings, + repeatDataPathResourceSettings, + repeatDataPathTrailingResourceSettings, + repeatDataBodyPutSettings, + repeatDataBodyPatchSettings, + getEnumSettings, + verifyEnumSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.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.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")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public ComplianceStubSettings build() throws IOException { + return new ComplianceStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java new file mode 100644 index 0000000000..fd0fe7d6b3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +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 UnaryCallable + echoErrorDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()"); + } + + public UnaryCallable + failEchoWithDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: failEchoWithDetailsCallable()"); + } + + 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()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java new file mode 100644 index 0000000000..4ca4053954 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -0,0 +1,981 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.core.ObsoleteApi; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +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.time.Duration; +import java.util.List; +import java.util.Map; +import javax.annotation.Generated; + +// 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of echo: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * EchoStubSettings echoSettings = echoSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for wait: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * echoSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .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 UnaryCallSettings + echoErrorDetailsSettings; + private final UnaryCallSettings + failEchoWithDetailsSettings; + 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 final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + 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(); + } + }; + + 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().entrySet(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + 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); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to echo. */ + public UnaryCallSettings echoSettings() { + return echoSettings; + } + + /** Returns the object with the settings used for calls to echoErrorDetails. */ + public UnaryCallSettings + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the object with the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** 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; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken(GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()) + .setApiVersionToken("v1_20240408"); + } + + public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(EchoStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()) + .setApiVersionToken("v1_20240408"); + } + + 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(); + echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build(); + failEchoWithDetailsSettings = settingsBuilder.failEchoWithDetailsSettings().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(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for EchoStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder echoSettings; + private final UnaryCallSettings.Builder + echoErrorDetailsSettings; + private final UnaryCallSettings.Builder + failEchoWithDetailsSettings; + 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 final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "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() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(Duration.ofMillis(10000L)) + .build(); + definitions.put("retry_policy_1_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(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(); + echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failEchoWithDetailsSettings = 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(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(EchoStubSettings settings) { + super(settings); + + echoSettings = settings.echoSettings.toBuilder(); + echoErrorDetailsSettings = settings.echoErrorDetailsSettings.toBuilder(); + failEchoWithDetailsSettings = settings.failEchoWithDetailsSettings.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(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + echoSettings, + echoErrorDetailsSettings, + failEchoWithDetailsSettings, + pagedExpandSettings, + pagedExpandLegacySettings, + pagedExpandLegacyMappedSettings, + waitSettings, + blockSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.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.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 + .echoErrorDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .failEchoWithDetailsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_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 + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .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() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(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 echoErrorDetails. */ + public UnaryCallSettings.Builder + echoErrorDetailsSettings() { + return echoErrorDetailsSettings; + } + + /** Returns the builder for the settings used for calls to failEchoWithDetails. */ + public UnaryCallSettings.Builder + failEchoWithDetailsSettings() { + return failEchoWithDetailsSettings; + } + + /** 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. */ + public OperationCallSettings.Builder + waitOperationSettings() { + return waitOperationSettings; + } + + /** Returns the builder for the settings used for calls to block. */ + public UnaryCallSettings.Builder blockSettings() { + return blockSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public EchoStubSettings build() throws IOException { + return new EchoStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java new file mode 100644 index 0000000000..6d1dad969b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java new file mode 100644 index 0000000000..1b4ff86061 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java @@ -0,0 +1,580 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.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.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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final 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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings repeatDataPathResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + GrpcCallSettings + repeatDataPathTrailingResourceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.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(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java new file mode 100644 index 0000000000..f22d1faaa4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java new file mode 100644 index 0000000000..4a2d9820af --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java @@ -0,0 +1,668 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +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.UUID; +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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + echoErrorDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + failEchoWithDetailsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setRequestMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(FailEchoWithDetailsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + 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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + 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(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + GrpcCallSettings + echoErrorDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .build(); + GrpcCallSettings + failEchoWithDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .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(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + 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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java new file mode 100644 index 0000000000..0b24326bf3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java new file mode 100644 index 0000000000..5260967a52 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcIdentityStub.java @@ -0,0 +1,448 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.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.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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final 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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteUserTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listUsersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java new file mode 100644 index 0000000000..b1410c4288 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java new file mode 100644 index 0000000000..2eb932b344 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcMessagingStub.java @@ -0,0 +1,747 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import 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.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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final 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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteRoomTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listRoomsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .build(); + GrpcCallSettings createBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteBlurbTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings searchBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings streamBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings sendBlurbsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(sendBlurbsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings connectTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(connectMethodDescriptor) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..a6aaad6597 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java new file mode 100644 index 0000000000..90a06a2ea1 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcSequenceServiceStub.java @@ -0,0 +1,512 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the 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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + createStreamingSequenceMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(StreamingSequence.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + getStreamingSequenceReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetStreamingSequenceReportRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingSequenceReport.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setRequestMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AttemptStreamingSequenceResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final 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 + createStreamingSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .build(); + GrpcCallSettings getSequenceReportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + getStreamingSequenceReportTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings attemptSequenceTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings + attemptStreamingSequenceTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java new file mode 100644 index 0000000000..adbfa10f91 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java new file mode 100644 index 0000000000..b485b9f36d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcTestingStub.java @@ -0,0 +1,557 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.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.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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .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())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + listLocationsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setRequestMarshaller( + ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getLocationMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor setIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(SetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor getIamPolicyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setRequestMarshaller(ProtoUtils.marshaller(GetIamPolicyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Policy.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + testIamPermissionsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setRequestMarshaller( + ProtoUtils.marshaller(TestIamPermissionsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(TestIamPermissionsResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final 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 -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listSessionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .build(); + GrpcCallSettings deleteSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings reportSessionTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listTestsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings verifyTestTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings setIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings getIamPolicyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + GrpcCallSettings + testIamPermissionsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java new file mode 100644 index 0000000000..a862d01764 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); + } + + @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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java new file mode 100644 index 0000000000..5bcc7c6fe1 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java @@ -0,0 +1,1109 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("info", request.getInfo(), false)) + .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()); + 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()); + 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()); + 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()); + 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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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()); + 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()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EnumResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final 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) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add("info.f_double", String.valueOf(request.getInfo().getFDouble())); + builder.add("info.f_int32", String.valueOf(request.getInfo().getFInt32())); + builder.add( + "info.f_kingdom", String.valueOf(request.getInfo().getFKingdomValue())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings repeatDataPathResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("info.f_bool", String.valueOf(request.getInfo().getFBool())); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + repeatDataPathTrailingResourceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataPathTrailingResourceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.f_child.f_string", + String.valueOf(request.getInfo().getFChild().getFString())); + builder.add("info.f_string", String.valueOf(request.getInfo().getFString())); + return builder.build(); + }) + .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(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(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); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java new file mode 100644 index 0000000000..ff4dcba729 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); + } + + @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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java new file mode 100644 index 0000000000..1a7f5e5cc4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java @@ -0,0 +1,1058 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandLegacyMappedPagedResponse; +import static com.google.showcase.v1beta1.EchoClient.PagedExpandPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoErrorDetailsRequest; +import com.google.showcase.v1beta1.EchoErrorDetailsResponse; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; +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.UUID; +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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + echoErrorDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/EchoErrorDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:error-details", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(EchoErrorDetailsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + failEchoWithDetailsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Echo/FailEchoWithDetails") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/echo:failWithDetails", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(FailEchoWithDetailsResponse.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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(BlockResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable echoCallable; + private final UnaryCallable + echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; + 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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + 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 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, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings echoTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoMethodDescriptor) + .setTypeRegistry(typeRegistry) + .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(); + }) + .setRequestMutator( + request -> { + EchoRequest.Builder requestBuilder = request.toBuilder(); + if (Strings.isNullOrEmpty(request.getRequestId())) { + requestBuilder.setRequestId(UUID.randomUUID().toString()); + } + if (Strings.isNullOrEmpty(request.getOtherRequestId())) { + requestBuilder.setOtherRequestId(UUID.randomUUID().toString()); + } + return requestBuilder.build(); + }) + .build(); + HttpJsonCallSettings + echoErrorDetailsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(echoErrorDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + failEchoWithDetailsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .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(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.echoCallable = + callableFactory.createUnaryCallable( + echoTransportSettings, settings.echoSettings(), clientContext); + this.echoErrorDetailsCallable = + callableFactory.createUnaryCallable( + echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + 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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(echoMethodDescriptor); + methodDescriptors.add(echoErrorDetailsMethodDescriptor); + methodDescriptors.add(failEchoWithDetailsMethodDescriptor); + methodDescriptors.add(expandMethodDescriptor); + methodDescriptors.add(pagedExpandMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMethodDescriptor); + methodDescriptors.add(pagedExpandLegacyMappedMethodDescriptor); + methodDescriptors.add(waitMethodDescriptor); + methodDescriptors.add(blockMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable echoCallable() { + return echoCallable; + } + + @Override + public UnaryCallable + echoErrorDetailsCallable() { + return echoErrorDetailsCallable; + } + + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + + @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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable collectCallable() { + throw new UnsupportedOperationException( + "Not implemented: collectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable chatCallable() { + throw new UnsupportedOperationException( + "Not implemented: chatCallable(). REST transport is not implemented for this method yet."); + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java new file mode 100644 index 0000000000..19b5dfa5a7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); + } + + @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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java new file mode 100644 index 0000000000..53a2149e7c --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonIdentityStub.java @@ -0,0 +1,735 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + 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()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("user", request.getUser(), false)) + .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(); + 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()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListUsersResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final 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) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("user.name", String.valueOf(request.getUser().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteUserTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteUserMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listUsersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listUsersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createUserMethodDescriptor); + methodDescriptors.add(getUserMethodDescriptor); + methodDescriptors.add(updateUserMethodDescriptor); + methodDescriptors.add(deleteUserMethodDescriptor); + methodDescriptors.add(listUsersMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java new file mode 100644 index 0000000000..666726fc52 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); + } + + @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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java new file mode 100644 index 0000000000..af225c30d7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonMessagingStub.java @@ -0,0 +1,1223 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +import static com.google.showcase.v1beta1.MessagingClient.ListRoomsPagedResponse; + +import com.google.api.HttpRule; +import com.google.api.core.BetaApi; +import com.google.api.core.InternalApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshot; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.ProtoMessageRequestFormatter; +import com.google.api.gax.httpjson.ProtoMessageResponseParser; +import com.google.api.gax.httpjson.ProtoRestSerializer; +import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub; +import com.google.api.gax.rpc.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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableMap; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +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.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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().build(), false)) + .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(); + 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()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("room", request.getRoom(), false)) + .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(); + 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()); + 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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .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(); + 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()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create().toBody("blurb", request.getBlurb(), false)) + .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(); + 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()); + 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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearParent().build(), false)) + .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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamBlurbsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final HttpJsonOperationsStub httpJsonOperationsStub; + private final HttpJsonStubCallableFactory callableFactory; + + public static final 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, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder().setPost("/v1beta1/{name=operations/**}:cancel").build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder().setDelete("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder().setGet("/v1beta1/{name=operations/**}").build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder().setGet("/v1beta1/operations").build()) + .build()); + + HttpJsonCallSettings createRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings getRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("room.name", String.valueOf(request.getRoom().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteRoomTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteRoomMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listRoomsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listRoomsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings createBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("blurb.name", String.valueOf(request.getBlurb().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteBlurbTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteBlurbMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings searchBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings streamBlurbsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(streamBlurbsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(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); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public ClientStreamingCallable sendBlurbsCallable() { + throw new UnsupportedOperationException( + "Not implemented: sendBlurbsCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public BidiStreamingCallable connectCallable() { + throw new UnsupportedOperationException( + "Not implemented: connectCallable(). REST transport is not implemented for this method" + + " yet."); + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java new file mode 100644 index 0000000000..9f2c729229 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); + } + + @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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java new file mode 100644 index 0000000000..2c7a3b5e26 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonSequenceServiceStub.java @@ -0,0 +1,820 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("sequence", request.getSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Sequence.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createStreamingSequenceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/CreateStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/streamingSequences", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "streamingSequence", request.getStreamingSequence(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequence.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(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SequenceReport.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName( + "google.showcase.v1beta1.SequenceService/GetStreamingSequenceReport") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(StreamingSequenceReport.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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Empty.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceMethodDescriptor = + ApiMethodDescriptor + .newBuilder() + .setFullMethodName("google.showcase.v1beta1.SequenceService/AttemptStreamingSequence") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.SERVER_STREAMING) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=streamingSequences/*}:stream", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearName().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(AttemptStreamingSequenceResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable createSequenceCallable; + private final UnaryCallable + createStreamingSequenceCallable; + private final UnaryCallable getSequenceReportCallable; + private final UnaryCallable + getStreamingSequenceReportCallable; + private final UnaryCallable attemptSequenceCallable; + private final ServerStreamingCallable< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceCallable; + private final UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final 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 + createStreamingSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + getSequenceReportTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getStreamingSequenceReportTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(getStreamingSequenceReportMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings attemptSequenceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(attemptSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + attemptStreamingSequenceTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(attemptStreamingSequenceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + + this.createSequenceCallable = + callableFactory.createUnaryCallable( + createSequenceTransportSettings, settings.createSequenceSettings(), clientContext); + this.createStreamingSequenceCallable = + callableFactory.createUnaryCallable( + createStreamingSequenceTransportSettings, + settings.createStreamingSequenceSettings(), + clientContext); + this.getSequenceReportCallable = + callableFactory.createUnaryCallable( + getSequenceReportTransportSettings, + settings.getSequenceReportSettings(), + clientContext); + this.getStreamingSequenceReportCallable = + callableFactory.createUnaryCallable( + getStreamingSequenceReportTransportSettings, + settings.getStreamingSequenceReportSettings(), + clientContext); + this.attemptSequenceCallable = + callableFactory.createUnaryCallable( + attemptSequenceTransportSettings, settings.attemptSequenceSettings(), clientContext); + this.attemptStreamingSequenceCallable = + callableFactory.createServerStreamingCallable( + attemptStreamingSequenceTransportSettings, + settings.attemptStreamingSequenceSettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSequenceMethodDescriptor); + methodDescriptors.add(createStreamingSequenceMethodDescriptor); + methodDescriptors.add(getSequenceReportMethodDescriptor); + methodDescriptors.add(getStreamingSequenceReportMethodDescriptor); + methodDescriptors.add(attemptSequenceMethodDescriptor); + methodDescriptors.add(attemptStreamingSequenceMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + return methodDescriptors; + } + + @Override + public UnaryCallable createSequenceCallable() { + return createSequenceCallable; + } + + @Override + public UnaryCallable + createStreamingSequenceCallable() { + return createStreamingSequenceCallable; + } + + @Override + public UnaryCallable getSequenceReportCallable() { + return getSequenceReportCallable; + } + + @Override + public UnaryCallable + getStreamingSequenceReportCallable() { + return getStreamingSequenceReportCallable; + } + + @Override + public UnaryCallable attemptSequenceCallable() { + return attemptSequenceCallable; + } + + @Override + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + return attemptStreamingSequenceCallable; + } + + @Override + public UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java new file mode 100644 index 0000000000..fc3e0297b0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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); + } + + @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/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java new file mode 100644 index 0000000000..11d87107de --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonTestingStub.java @@ -0,0 +1,916 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("session", request.getSession(), false)) + .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(); + 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()); + 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(); + 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(); + 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()); + 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(); + 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()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(VerifyTestResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + setIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/SetIamPolicy") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:setIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:setIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:setIamPolicy", + "/v1beta1/{resource=sequences/*}:setIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getIamPolicyMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/GetIamPolicy") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:getIamPolicy", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:getIamPolicy", + "/v1beta1/{resource=rooms/*/blurbs/*}:getIamPolicy", + "/v1beta1/{resource=sequences/*}:getIamPolicy") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Policy.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + testIamPermissionsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.iam.v1.IAMPolicy/TestIamPermissions") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{resource=users/*}:testIamPermissions", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "resource", request.getResource()); + return fields; + }) + .setAdditionalPaths( + "/v1beta1/{resource=rooms/*}:testIamPermissions", + "/v1beta1/{resource=rooms/*/blurbs/*}:testIamPermissions", + "/v1beta1/{resource=sequences/*}:testIamPermissions") + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("*", request.toBuilder().clearResource().build(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(TestIamPermissionsResponse.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 UnaryCallable listLocationsCallable; + private final UnaryCallable + listLocationsPagedCallable; + private final UnaryCallable getLocationCallable; + private final UnaryCallable setIamPolicyCallable; + private final UnaryCallable getIamPolicyCallable; + private final UnaryCallable + testIamPermissionsCallable; + + private final BackgroundResource backgroundResources; + private final 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) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listSessionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listSessionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings deleteSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + reportSessionTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(reportSessionMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings listTestsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listTestsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings verifyTestTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(verifyTestMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings setIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(setIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getIamPolicyTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getIamPolicyMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + testIamPermissionsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(testIamPermissionsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("resource", String.valueOf(request.getResource())); + return builder.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.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + this.setIamPolicyCallable = + callableFactory.createUnaryCallable( + setIamPolicyTransportSettings, settings.setIamPolicySettings(), clientContext); + this.getIamPolicyCallable = + callableFactory.createUnaryCallable( + getIamPolicyTransportSettings, settings.getIamPolicySettings(), clientContext); + this.testIamPermissionsCallable = + callableFactory.createUnaryCallable( + testIamPermissionsTransportSettings, + settings.testIamPermissionsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(createSessionMethodDescriptor); + methodDescriptors.add(getSessionMethodDescriptor); + methodDescriptors.add(listSessionsMethodDescriptor); + methodDescriptors.add(deleteSessionMethodDescriptor); + methodDescriptors.add(reportSessionMethodDescriptor); + methodDescriptors.add(listTestsMethodDescriptor); + methodDescriptors.add(deleteTestMethodDescriptor); + methodDescriptors.add(verifyTestMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + methodDescriptors.add(setIamPolicyMethodDescriptor); + methodDescriptors.add(getIamPolicyMethodDescriptor); + methodDescriptors.add(testIamPermissionsMethodDescriptor); + 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 UnaryCallable listLocationsCallable() { + return listLocationsCallable; + } + + @Override + public UnaryCallable + listLocationsPagedCallable() { + return listLocationsPagedCallable; + } + + @Override + public UnaryCallable getLocationCallable() { + return getLocationCallable; + } + + @Override + public UnaryCallable setIamPolicyCallable() { + return setIamPolicyCallable; + } + + @Override + public UnaryCallable getIamPolicyCallable() { + return getIamPolicyCallable; + } + + @Override + public UnaryCallable + testIamPermissionsCallable() { + return testIamPermissionsCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java new file mode 100644 index 0000000000..0993f240a7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStub.java @@ -0,0 +1,106 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java new file mode 100644 index 0000000000..3415264909 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/IdentityStubSettings.java @@ -0,0 +1,682 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.core.ObsoleteApi; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createUser: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * IdentityStubSettings identitySettings = identitySettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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 final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + 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(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + 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); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to 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; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(IdentityStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + 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(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().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 final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + 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() + .setInitialRetryDelayDuration(Duration.ofMillis(200L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(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); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + 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(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createUserSettings, + getUserSettings, + updateUserSettings, + deleteUserSettings, + listUsersSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.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.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")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public IdentityStubSettings build() throws IOException { + return new IdentityStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java new file mode 100644 index 0000000000..45f38d5e07 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStub.java @@ -0,0 +1,180 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Empty; +import 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()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java new file mode 100644 index 0000000000..84828250d7 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/MessagingStubSettings.java @@ -0,0 +1,1027 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.core.ObsoleteApi; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import 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.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createRoom: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MessagingStubSettings messagingSettings = messagingSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for searchBlurbs: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * messagingSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .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 final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + 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(); + } + }; + + 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(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + 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); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to 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; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(MessagingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + 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(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().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 final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(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(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + 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(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createRoomSettings, + getRoomSettings, + updateRoomSettings, + deleteRoomSettings, + listRoomsSettings, + createBlurbSettings, + getBlurbSettings, + updateBlurbSettings, + deleteBlurbSettings, + listBlurbsSettings, + searchBlurbsSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.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.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 + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .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() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(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. */ + 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; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public MessagingStubSettings build() throws IOException { + return new MessagingStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java new file mode 100644 index 0000000000..10ffc4271d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStub.java @@ -0,0 +1,114 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +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 + createStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: createStreamingSequenceCallable()"); + } + + public UnaryCallable getSequenceReportCallable() { + throw new UnsupportedOperationException("Not implemented: getSequenceReportCallable()"); + } + + public UnaryCallable + getStreamingSequenceReportCallable() { + throw new UnsupportedOperationException( + "Not implemented: getStreamingSequenceReportCallable()"); + } + + public UnaryCallable attemptSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptSequenceCallable()"); + } + + public ServerStreamingCallable + attemptStreamingSequenceCallable() { + throw new UnsupportedOperationException("Not implemented: attemptStreamingSequenceCallable()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java new file mode 100644 index 0000000000..00bc19a4c0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/SequenceServiceStubSettings.java @@ -0,0 +1,681 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.ServerStreamingCallSettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Empty; +import com.google.showcase.v1beta1.AttemptSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceRequest; +import com.google.showcase.v1beta1.AttemptStreamingSequenceResponse; +import com.google.showcase.v1beta1.CreateSequenceRequest; +import com.google.showcase.v1beta1.CreateStreamingSequenceRequest; +import com.google.showcase.v1beta1.GetSequenceReportRequest; +import com.google.showcase.v1beta1.GetStreamingSequenceReportRequest; +import com.google.showcase.v1beta1.Sequence; +import com.google.showcase.v1beta1.SequenceReport; +import com.google.showcase.v1beta1.StreamingSequence; +import com.google.showcase.v1beta1.StreamingSequenceReport; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSequence: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * SequenceServiceStubSettings sequenceServiceSettings = sequenceServiceSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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 + createStreamingSequenceSettings; + private final UnaryCallSettings + getSequenceReportSettings; + private final UnaryCallSettings + getStreamingSequenceReportSettings; + private final UnaryCallSettings attemptSequenceSettings; + private final ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to createSequence. */ + public UnaryCallSettings createSequenceSettings() { + return createSequenceSettings; + } + + /** Returns the object with the settings used for calls to createStreamingSequence. */ + public UnaryCallSettings + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** 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 getStreamingSequenceReport. */ + public UnaryCallSettings + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the object with the settings used for calls to attemptSequence. */ + public UnaryCallSettings attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the object with the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(SequenceServiceStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + 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(); + createStreamingSequenceSettings = settingsBuilder.createStreamingSequenceSettings().build(); + getSequenceReportSettings = settingsBuilder.getSequenceReportSettings().build(); + getStreamingSequenceReportSettings = + settingsBuilder.getStreamingSequenceReportSettings().build(); + attemptSequenceSettings = settingsBuilder.attemptSequenceSettings().build(); + attemptStreamingSequenceSettings = settingsBuilder.attemptStreamingSequenceSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().build(); + } + + /** Builder for SequenceServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder createSequenceSettings; + private final UnaryCallSettings.Builder + createStreamingSequenceSettings; + private final UnaryCallSettings.Builder + getSequenceReportSettings; + private final UnaryCallSettings.Builder< + GetStreamingSequenceReportRequest, StreamingSequenceReport> + getStreamingSequenceReportSettings; + private final UnaryCallSettings.Builder attemptSequenceSettings; + private final ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "no_retry_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() + .setInitialRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(5000L)) + .setTotalTimeoutDuration(Duration.ofMillis(5000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelayDuration(Duration.ofMillis(3000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(10000L)) + .setTotalTimeoutDuration(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(); + createStreamingSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getStreamingSequenceReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptSequenceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + attemptStreamingSequenceSettings = ServerStreamingCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + initDefaults(this); + } + + protected Builder(SequenceServiceStubSettings settings) { + super(settings); + + createSequenceSettings = settings.createSequenceSettings.toBuilder(); + createStreamingSequenceSettings = settings.createStreamingSequenceSettings.toBuilder(); + getSequenceReportSettings = settings.getSequenceReportSettings.toBuilder(); + getStreamingSequenceReportSettings = settings.getStreamingSequenceReportSettings.toBuilder(); + attemptSequenceSettings = settings.attemptSequenceSettings.toBuilder(); + attemptStreamingSequenceSettings = settings.attemptStreamingSequenceSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSequenceSettings, + createStreamingSequenceSettings, + getSequenceReportSettings, + getStreamingSequenceReportSettings, + attemptSequenceSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.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.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 + .createStreamingSequenceSettings() + .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 + .getStreamingSequenceReportSettings() + .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")); + + builder + .attemptStreamingSequenceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + 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 createStreamingSequence. */ + public UnaryCallSettings.Builder + createStreamingSequenceSettings() { + return createStreamingSequenceSettings; + } + + /** 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 getStreamingSequenceReport. */ + public UnaryCallSettings.Builder + getStreamingSequenceReportSettings() { + return getStreamingSequenceReportSettings; + } + + /** Returns the builder for the settings used for calls to attemptSequence. */ + public UnaryCallSettings.Builder attemptSequenceSettings() { + return attemptSequenceSettings; + } + + /** Returns the builder for the settings used for calls to attemptStreamingSequence. */ + public ServerStreamingCallSettings.Builder< + AttemptStreamingSequenceRequest, AttemptStreamingSequenceResponse> + attemptStreamingSequenceSettings() { + return attemptStreamingSequenceSettings; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public SequenceServiceStubSettings build() throws IOException { + return new SequenceServiceStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java new file mode 100644 index 0000000000..fba2d4fa93 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStub.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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()"); + } + + public UnaryCallable + listLocationsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); + } + + public UnaryCallable listLocationsCallable() { + throw new UnsupportedOperationException("Not implemented: listLocationsCallable()"); + } + + public UnaryCallable getLocationCallable() { + throw new UnsupportedOperationException("Not implemented: getLocationCallable()"); + } + + public UnaryCallable setIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: setIamPolicyCallable()"); + } + + public UnaryCallable getIamPolicyCallable() { + throw new UnsupportedOperationException("Not implemented: getIamPolicyCallable()"); + } + + public UnaryCallable + testIamPermissionsCallable() { + throw new UnsupportedOperationException("Not implemented: testIamPermissionsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java new file mode 100644 index 0000000000..0f1fa4ad5b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/TestingStubSettings.java @@ -0,0 +1,801 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.core.ObsoleteApi; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of createSession: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require 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()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * TestingStubSettings testingSettings = testingSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + */ +@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 final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + private final UnaryCallSettings setIamPolicySettings; + private final UnaryCallSettings getIamPolicySettings; + private final UnaryCallSettings + testIamPermissionsSettings; + + private static final PagedListDescriptor + 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(); + } + }; + + 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(); + } + }; + + private static final PagedListDescriptor + LIST_LOCATIONS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) { + return ListLocationsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) { + return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListLocationsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListLocationsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListLocationsResponse payload) { + return payload.getLocationsList(); + } + }; + + 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); + } + }; + + private static final PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + LIST_LOCATIONS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListLocationsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context); + return ListLocationsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to 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; + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + /** Returns the object with the settings used for calls to setIamPolicy. */ + public UnaryCallSettings setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the object with the settings used for calls to getIamPolicy. */ + public UnaryCallSettings getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the object with the settings used for calls to testIamPermissions. */ + public UnaryCallSettings + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + public 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. */ + @ObsoleteApi("Use getEndpoint() instead") + 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(); + } + + public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken("gapic", GaxProperties.getLibraryVersion(TestingStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + 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(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); + getIamPolicySettings = settingsBuilder.getIamPolicySettings().build(); + testIamPermissionsSettings = settingsBuilder.testIamPermissionsSettings().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 final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private final UnaryCallSettings.Builder setIamPolicySettings; + private final UnaryCallSettings.Builder getIamPolicySettings; + private final UnaryCallSettings.Builder + testIamPermissionsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + 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(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + getIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + testIamPermissionsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + 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(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); + getIamPolicySettings = settings.getIamPolicySettings.toBuilder(); + testIamPermissionsSettings = settings.testIamPermissionsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createSessionSettings, + getSessionSettings, + listSessionsSettings, + deleteSessionSettings, + reportSessionSettings, + listTestsSettings, + deleteTestSettings, + verifyTestSettings, + listLocationsSettings, + getLocationSettings, + setIamPolicySettings, + getIamPolicySettings, + testIamPermissionsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.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.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")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .setIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getIamPolicySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .testIamPermissionsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + 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; + } + + /** Returns the builder for the settings used for calls to listLocations. */ + public PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the builder for the settings used for calls to getLocation. */ + public UnaryCallSettings.Builder getLocationSettings() { + return getLocationSettings; + } + + /** Returns the builder for the settings used for calls to setIamPolicy. */ + public UnaryCallSettings.Builder setIamPolicySettings() { + return setIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to getIamPolicy. */ + public UnaryCallSettings.Builder getIamPolicySettings() { + return getIamPolicySettings; + } + + /** Returns the builder for the settings used for calls to testIamPermissions. */ + public UnaryCallSettings.Builder + testIamPermissionsSettings() { + return testIamPermissionsSettings; + } + + @Override + public TestingStubSettings build() throws IOException { + return new TestingStubSettings(this); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json b/java-showcase-3.21.0/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json new file mode 100644 index 0000000000..077caee652 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json @@ -0,0 +1,3674 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingParameter$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RoutingRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditConfigDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.AuditLogConfig$LogType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Binding$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.BindingDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.GetPolicyOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.Policy$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.PolicyDelta$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.SetIamPolicyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.iam.v1.TestIamPermissionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.BadRequest$FieldViolation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Code", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.DebugInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ErrorInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Help$Link$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.LocalizedMessage$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.PreconditionFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.QuotaFailure$Violation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RequestInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.ResourceInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.RetryInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.AttemptStreamingSequenceResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.BlockResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Blurb$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceData$LifeKingdom", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataChild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceDataGrandchild$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceGroup$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ComplianceSuite$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ConnectRequest$ConnectConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Continent", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateStreamingSequenceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CreateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.DeleteUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$MultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoErrorDetailsResponse$SingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EchoResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.EnumResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithMultipleDetails$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ErrorWithSingleDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.FailEchoWithDetailsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetStreamingSequenceReportRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.GetUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Issue$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListRoomsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListSessionsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListTestsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ListUsersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandLegacyRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PagedExpandResponseList$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.PoetryError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RepeatResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.ReportSessionResponse$Result", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.RestError$Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Room$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SearchBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SendBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Sequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.SequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Session$Version", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Action", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamBlurbsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequence$Response$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Attempt$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.StreamingSequenceReport$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Blueprint$Invocation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.Test$ExpectationLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.TestRun$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateBlurbRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateRoomRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.UpdateUserRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.User$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.VerifyTestResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.WaitResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.type.Expr$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java new file mode 100644 index 0000000000..345817b5e5 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java @@ -0,0 +1,1215 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonComplianceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java new file mode 100644 index 0000000000..8f76905d59 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java @@ -0,0 +1,1014 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ComplianceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private ComplianceClient client; + + @BeforeClass + public static void startStaticServer() { + mockCompliance = new MockCompliance(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCompliance, mockLocations, mockIAMPolicy)); + 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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java new file mode 100644 index 0000000000..a558473f2f --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java @@ -0,0 +1,827 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +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.HashMap; +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)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockService.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .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") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(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 echoErrorDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockService.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(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 failEchoWithDetailsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java new file mode 100644 index 0000000000..44ce3dff79 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java @@ -0,0 +1,941 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Duration; +import com.google.protobuf.FieldMask; +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.HashMap; +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 MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private EchoClient client; + + @BeforeClass + public static void startStaticServer() { + mockEcho = new MockEcho(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockEcho, mockLocations, mockIAMPolicy)); + 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)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .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.assertEquals(request.getRequestId(), actualRequest.getRequestId()); + Assert.assertEquals(request.getOtherRequestId(), actualRequest.getOtherRequestId()); + 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") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + client.echo(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void echoErrorDetailsTest() throws Exception { + EchoErrorDetailsResponse expectedResponse = + EchoErrorDetailsResponse.newBuilder() + .setSingleDetail(EchoErrorDetailsResponse.SingleDetail.newBuilder().build()) + .setMultipleDetails(EchoErrorDetailsResponse.MultipleDetails.newBuilder().build()) + .build(); + mockEcho.addResponse(expectedResponse); + + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + + EchoErrorDetailsResponse actualResponse = client.echoErrorDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + EchoErrorDetailsRequest actualRequest = ((EchoErrorDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getSingleDetailText(), actualRequest.getSingleDetailText()); + Assert.assertEquals(request.getMultiDetailTextList(), actualRequest.getMultiDetailTextList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void echoErrorDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + EchoErrorDetailsRequest request = + EchoErrorDetailsRequest.newBuilder() + .setSingleDetailText("singleDetailText1774380934") + .addAllMultiDetailText(new ArrayList()) + .build(); + client.echoErrorDetails(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void failEchoWithDetailsTest() throws Exception { + FailEchoWithDetailsResponse expectedResponse = FailEchoWithDetailsResponse.newBuilder().build(); + mockEcho.addResponse(expectedResponse); + + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + + FailEchoWithDetailsResponse actualResponse = client.failEchoWithDetails(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEcho.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + FailEchoWithDetailsRequest actualRequest = ((FailEchoWithDetailsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getMessage(), actualRequest.getMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void failEchoWithDetailsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEcho.addException(exception); + + try { + FailEchoWithDetailsRequest request = + FailEchoWithDetailsRequest.newBuilder().setMessage("message954925063").build(); + client.failEchoWithDetails(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)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + ExpandRequest request = + ExpandRequest.newBuilder() + .setContent("content951530617") + .setError(Status.newBuilder().build()) + .setStreamWaitTime(Duration.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()) + .setStreamWaitTime(Duration.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)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .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") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .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)) + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .build(); + mockEcho.addResponse(expectedResponse); + EchoRequest request = + EchoRequest.newBuilder() + .setSeverity(Severity.forNumber(0)) + .setHeader("header-1221270899") + .setOtherHeader("otherHeader-2026585667") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .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") + .setRequestId("requestId693933066") + .setOtherRequestId("otherRequestId1248995034") + .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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java new file mode 100644 index 0000000000..fb43faeb39 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientHttpJsonTest.java @@ -0,0 +1,815 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.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.HttpJsonIdentityStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java new file mode 100644 index 0000000000..a799116534 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/IdentityClientTest.java @@ -0,0 +1,733 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 MockIAMPolicy mockIAMPolicy; + private static MockIdentity mockIdentity; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private IdentityClient client; + + @BeforeClass + public static void startStaticServer() { + mockIdentity = new MockIdentity(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockIdentity, mockLocations, mockIAMPolicy)); + 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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java new file mode 100644 index 0000000000..bdeb1df2f5 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientHttpJsonTest.java @@ -0,0 +1,1937 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.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.HashMap; +import java.util.List; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class 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.ofRoomBlurbName("[ROOM]", "[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.ofRoomBlurbName("[ROOM]", "[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. + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java new file mode 100644 index 0000000000..65b8248d12 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MessagingClientTest.java @@ -0,0 +1,1882 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class MessagingClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockMessaging mockMessaging; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private MessagingClient client; + + @BeforeClass + public static void startStaticServer() { + mockMessaging = new MockMessaging(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockMessaging, mockLocations, mockIAMPolicy)); + 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()); + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java new file mode 100644 index 0000000000..dbf0d0e821 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockCompliance.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java new file mode 100644 index 0000000000..935a0a8532 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java @@ -0,0 +1,271 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java new file mode 100644 index 0000000000..fc9db96a3e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEcho.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java new file mode 100644 index 0000000000..f505bb9ad9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java @@ -0,0 +1,321 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 echoErrorDetails( + EchoErrorDetailsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof EchoErrorDetailsResponse) { + requests.add(request); + responseObserver.onNext(((EchoErrorDetailsResponse) 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 EchoErrorDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + EchoErrorDetailsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void failEchoWithDetails( + FailEchoWithDetailsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof FailEchoWithDetailsResponse) { + requests.add(request); + responseObserver.onNext(((FailEchoWithDetailsResponse) 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 FailEchoWithDetails, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + FailEchoWithDetailsResponse.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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java new file mode 100644 index 0000000000..ef37c3d404 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicy.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 MockIAMPolicy implements MockGrpcService { + private final MockIAMPolicyImpl serviceImpl; + + public MockIAMPolicy() { + serviceImpl = new MockIAMPolicyImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java new file mode 100644 index 0000000000..3c9b26728b --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIAMPolicyImpl.java @@ -0,0 +1,127 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.IAMPolicyGrpc.IAMPolicyImplBase; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockIAMPolicyImpl extends IAMPolicyImplBase { + private List requests; + private Queue responses; + + public MockIAMPolicyImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void testIamPermissions( + TestIamPermissionsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof TestIamPermissionsResponse) { + requests.add(request); + responseObserver.onNext(((TestIamPermissionsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void setIamPolicy(SetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getIamPolicy(GetIamPolicyRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Policy) { + requests.add(request); + responseObserver.onNext(((Policy) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java new file mode 100644 index 0000000000..e6b7dd1c46 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentity.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java new file mode 100644 index 0000000000..31b7602e49 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockIdentityImpl.java @@ -0,0 +1,162 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java new file mode 100644 index 0000000000..43855bd7e0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 MockLocations implements MockGrpcService { + private final MockLocationsImpl serviceImpl; + + public MockLocations() { + serviceImpl = new MockLocationsImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java new file mode 100644 index 0000000000..59502a268d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.location.LocationsGrpc.LocationsImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockLocationsImpl extends LocationsImplBase { + private List requests; + private Queue responses; + + public MockLocationsImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void listLocations( + ListLocationsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListLocationsResponse) { + requests.add(request); + responseObserver.onNext(((ListLocationsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListLocations, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListLocationsResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getLocation(GetLocationRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Location) { + requests.add(request); + responseObserver.onNext(((Location) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetLocation, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Location.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java new file mode 100644 index 0000000000..b9517576ed --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessaging.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java new file mode 100644 index 0000000000..2a36840c7c --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockMessagingImpl.java @@ -0,0 +1,380 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java new file mode 100644 index 0000000000..606571e14d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java new file mode 100644 index 0000000000..92e5fb15c8 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockSequenceServiceImpl.java @@ -0,0 +1,192 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 createStreamingSequence( + CreateStreamingSequenceRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequence) { + requests.add(request); + responseObserver.onNext(((StreamingSequence) 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 CreateStreamingSequence, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequence.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 getStreamingSequenceReport( + GetStreamingSequenceReportRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof StreamingSequenceReport) { + requests.add(request); + responseObserver.onNext(((StreamingSequenceReport) 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 GetStreamingSequenceReport, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + StreamingSequenceReport.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()))); + } + } + + @Override + public void attemptStreamingSequence( + AttemptStreamingSequenceRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof AttemptStreamingSequenceResponse) { + requests.add(request); + responseObserver.onNext(((AttemptStreamingSequenceResponse) 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 AttemptStreamingSequence, expected %s" + + " or %s", + response == null ? "null" : response.getClass().getName(), + AttemptStreamingSequenceResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java new file mode 100644 index 0000000000..c03ddbbe4a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTesting.java @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java new file mode 100644 index 0000000000..a73afd59a3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockTestingImpl.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java new file mode 100644 index 0000000000..6dc92ad8b4 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientHttpJsonTest.java @@ -0,0 +1,735 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.testing.MockHttpService; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ApiException; +import com.google.api.gax.rpc.ApiExceptionFactory; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.testing.FakeStatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonSequenceServiceStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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 createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + 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 createStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + 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 getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(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 getStreamingSequenceReportExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(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 getStreamingSequenceReportExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "streamingSequences/streamingSequence-962/streamingSequenceReport"; + client.getStreamingSequenceReport(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. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception {} + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java new file mode 100644 index 0000000000..43d36555c0 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/SequenceServiceClientTest.java @@ -0,0 +1,712 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.SequenceServiceClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.grpc.testing.MockStreamObserver; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StatusCode; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class SequenceServiceClientTest { + private static MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockSequenceService mockSequenceService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private SequenceServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockSequenceService = new MockSequenceService(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockSequenceService, mockLocations, mockIAMPolicy)); + 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 createStreamingSequenceTest() throws Exception { + StreamingSequence expectedResponse = + StreamingSequence.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setContent("content951530617") + .addAllResponses(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + + StreamingSequence actualResponse = client.createStreamingSequence(streamingSequence); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateStreamingSequenceRequest actualRequest = + ((CreateStreamingSequenceRequest) actualRequests.get(0)); + + Assert.assertEquals(streamingSequence, actualRequest.getStreamingSequence()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void createStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequence streamingSequence = StreamingSequence.newBuilder().build(); + client.createStreamingSequence(streamingSequence); + 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 getStreamingSequenceReportTest() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + StreamingSequenceReportName name = StreamingSequenceReportName.of("[STREAMING_SEQUENCE]"); + client.getStreamingSequenceReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getStreamingSequenceReportTest2() throws Exception { + StreamingSequenceReport expectedResponse = + StreamingSequenceReport.newBuilder() + .setName(StreamingSequenceReportName.of("[STREAMING_SEQUENCE]").toString()) + .addAllAttempts(new ArrayList()) + .build(); + mockSequenceService.addResponse(expectedResponse); + + String name = "name3373707"; + + StreamingSequenceReport actualResponse = client.getStreamingSequenceReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockSequenceService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetStreamingSequenceReportRequest actualRequest = + ((GetStreamingSequenceReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getStreamingSequenceReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + + try { + String name = "name3373707"; + client.getStreamingSequenceReport(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. + } + } + + @Test + public void attemptStreamingSequenceTest() throws Exception { + AttemptStreamingSequenceResponse expectedResponse = + AttemptStreamingSequenceResponse.newBuilder().setContent("content951530617").build(); + mockSequenceService.addResponse(expectedResponse); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + callable.serverStreamingCall(request, responseObserver); + + List actualResponses = responseObserver.future().get(); + Assert.assertEquals(1, actualResponses.size()); + Assert.assertEquals(expectedResponse, actualResponses.get(0)); + } + + @Test + public void attemptStreamingSequenceExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockSequenceService.addException(exception); + AttemptStreamingSequenceRequest request = + AttemptStreamingSequenceRequest.newBuilder() + .setName(StreamingSequenceName.of("[STREAMING_SEQUENCE]").toString()) + .setLastFailIndex(2006482362) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + ServerStreamingCallable + callable = client.attemptStreamingSequenceCallable(); + 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 listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java new file mode 100644 index 0000000000..5a6df6a7ee --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientHttpJsonTest.java @@ -0,0 +1,766 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.stub.HttpJsonTestingStub; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockService.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockService.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java new file mode 100644 index 0000000000..1d6280165d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/TestingClientTest.java @@ -0,0 +1,703 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ListLocationsPagedResponse; +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.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.common.collect.Lists; +import com.google.iam.v1.AuditConfig; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.GetPolicyOptions; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import 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 MockIAMPolicy mockIAMPolicy; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private static MockTesting mockTesting; + private LocalChannelProvider channelProvider; + private TestingClient client; + + @BeforeClass + public static void startStaticServer() { + mockTesting = new MockTesting(); + mockLocations = new MockLocations(); + mockIAMPolicy = new MockIAMPolicy(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockTesting, mockLocations, mockIAMPolicy)); + 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. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockLocations.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListLocationsRequest actualRequest = ((ListLocationsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getFilter(), actualRequest.getFilter()); + Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize()); + Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockLocations.addResponse(expectedResponse); + + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockLocations.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetLocationRequest actualRequest = ((GetLocationRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getLocationExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockLocations.addException(exception); + + try { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void setIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + + Policy actualResponse = client.setIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SetIamPolicyRequest actualRequest = ((SetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPolicy(), actualRequest.getPolicy()); + Assert.assertEquals(request.getUpdateMask(), actualRequest.getUpdateMask()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void setIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + SetIamPolicyRequest request = + SetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setPolicy(Policy.newBuilder().build()) + .setUpdateMask(FieldMask.newBuilder().build()) + .build(); + client.setIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getIamPolicyTest() throws Exception { + Policy expectedResponse = + Policy.newBuilder() + .setVersion(351608024) + .addAllBindings(new ArrayList()) + .addAllAuditConfigs(new ArrayList()) + .setEtag(ByteString.EMPTY) + .build(); + mockIAMPolicy.addResponse(expectedResponse); + + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + + Policy actualResponse = client.getIamPolicy(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetIamPolicyRequest actualRequest = ((GetIamPolicyRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getOptions(), actualRequest.getOptions()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getIamPolicyExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + GetIamPolicyRequest request = + GetIamPolicyRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .setOptions(GetPolicyOptions.newBuilder().build()) + .build(); + client.getIamPolicy(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void testIamPermissionsTest() throws Exception { + TestIamPermissionsResponse expectedResponse = + TestIamPermissionsResponse.newBuilder().addAllPermissions(new ArrayList()).build(); + mockIAMPolicy.addResponse(expectedResponse); + + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + + TestIamPermissionsResponse actualResponse = client.testIamPermissions(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockIAMPolicy.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + TestIamPermissionsRequest actualRequest = ((TestIamPermissionsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getResource(), actualRequest.getResource()); + Assert.assertEquals(request.getPermissionsList(), actualRequest.getPermissionsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void testIamPermissionsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockIAMPolicy.addException(exception); + + try { + TestIamPermissionsRequest request = + TestIamPermissionsRequest.newBuilder() + .setResource(BlurbName.ofRoomBlurbName("[ROOM]", "[BLURB]").toString()) + .addAllPermissions(new ArrayList()) + .build(); + client.testIamPermissions(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java new file mode 100644 index 0000000000..5867bcfea9 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITApiKeyCredentials.java @@ -0,0 +1,219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.auth.http.AuthHttpConstants; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import io.grpc.Metadata; +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 java.util.stream.Collectors; +import java.util.stream.StreamSupport; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Test suite to confirm a client can be instantiated with API key credentials and correct + * authorization sent via headers to back end + */ +class ITApiKeyCredentials { + + private static final String API_KEY = "fake_api_key"; + private static final String API_KEY_AUTH_HEADER = "x-goog-api-key"; + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + API_KEY_AUTH_HEADER; + private static final String GRPC_ENDPOINT = "localhost:7469"; + private static final String HTTP_ENDPOINT = "http://localhost:7469"; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static GrpcCapturingClientInterceptor grpcInterceptor; + + @BeforeEach + void setup() throws IOException { + grpcInterceptor = new GrpcCapturingClientInterceptor(); + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (httpJsonClient != null) { + httpJsonClient.close(); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + if (grpcClient != null) { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testCreateGrpcClient_withApiKey_sendsApiHeaderToServer() throws IOException { + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + EchoSettings.Builder echoBuilder = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build()); + EchoSettings settings = echoBuilder.build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + assertThat(echoBuilder.getApiKey()).isEqualTo(API_KEY); + assertThat(settings.getApiKey()).isEqualTo(API_KEY); + String headerValue = grpcInterceptor.metadata.get(apiKeyAuthHeader); + assertThat(headerValue).isEqualTo(API_KEY); + String defaultAuthorizationHeaderValue = + grpcInterceptor.metadata.get(defaultAuthorizationHeader); + assertThat(defaultAuthorizationHeaderValue).isNull(); + } + + @Test + void testCreateGrpcClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws IOException { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> ImmutableList.of(grpcInterceptor)) + .build(); + EchoSettings settings = + EchoSettings.newBuilder() + .setApiKey(API_KEY) + .setEndpoint(GRPC_ENDPOINT) + .setTransportChannelProvider(transportChannelProvider) + .build(); + grpcClient = EchoClient.create(settings); + + grpcClient.echo(EchoRequest.newBuilder().build()); + + Iterable matchingHeaders = grpcInterceptor.metadata.getAll(apiKeyAuthHeader); + List matchingHeadersList = + StreamSupport.stream(matchingHeaders.spliterator(), false).collect(Collectors.toList()); + + String headerValue = matchingHeadersList.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(matchingHeadersList.size()).isEqualTo(1); + } + + @Test + void testCreateHttpClient_withApiKey_sendsApiHeaderToServer() throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + } + + @Test + void testCreateHttpClient_withApiKeySetViaSetterAndHeader_dedupsHeader() throws Exception { + String apiHeaderKey = "fake_api_key_2"; + Metadata.Key apiKeyAuthHeader = + Metadata.Key.of(API_KEY_AUTH_HEADER, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key defaultAuthorizationHeader = + Metadata.Key.of(AuthHttpConstants.AUTHORIZATION, Metadata.ASCII_STRING_MARSHALLER); + Map header = + new HashMap() { + { + put(API_KEY_AUTH_HEADER, apiHeaderKey); + } + }; + FixedHeaderProvider headerProvider = FixedHeaderProvider.create(header); + + TransportChannelProvider transportChannelProvider = + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHeaderProvider(headerProvider) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build(); + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setApiKey(API_KEY) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(HTTP_ENDPOINT) + .setInterceptorProvider(() -> ImmutableList.of(httpJsonInterceptor)) + .build()) + .build(); + httpJsonClient = EchoClient.create(httpJsonEchoSettings); + + httpJsonClient.echo(EchoRequest.newBuilder().build()); + + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = headerValues.get(0); + assertThat(headerValue).isEqualTo(API_KEY); + assertThat(headerValues.size()).isEqualTo(1); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java new file mode 100644 index 0000000000..f73b6b3c7d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITAutoPopulatedFields.java @@ -0,0 +1,379 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.MethodDescriptor; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITAutoPopulatedFields { + + private static class HttpJsonInterceptor implements HttpJsonClientInterceptor { + private Consumer onRequestIntercepted; + + private HttpJsonInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + // Implement a request interceptor to retrieve the request ID being sent on the request. + private static class GRPCInterceptor implements ClientInterceptor { + private Consumer onRequestIntercepted; + + private GRPCInterceptor() {} + + private void setOnRequestIntercepted(Consumer onRequestIntercepted) { + this.onRequestIntercepted = onRequestIntercepted; + } + + @Override + public ClientCall interceptCall( + MethodDescriptor method, CallOptions callOptions, Channel next) { + + return new ForwardingClientCall.SimpleForwardingClientCall( + next.newCall(method, callOptions)) { + @Override + public void sendMessage(ReqT message) { + // Capture the request message + if (onRequestIntercepted != null) { + onRequestIntercepted.accept(message); + } + super.sendMessage(message); + } + }; + } + } + + private GRPCInterceptor grpcRequestInterceptor; + private HttpJsonInterceptor httpJsonInterceptor; + private EchoClient grpcClientWithoutRetries; + private EchoClient grpcClientWithRetries; + + private EchoClient httpJsonClient; + private EchoClient httpJsonClientWithRetries; + + @BeforeEach + void createClients() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Cap retries at 5 + .setMaxAttempts(5) + .build(); + + // Adding `Code.INTERNAL` is necessary because for httpJson requests, the httpJson status code + // is mapped here: + // https://github.com/googleapis/sdk-platform-java/blob/acdde47445916dd306ce8b91489fab45c9c2ef50/gax-java/gax-httpjson/src/main/java/com/google/api/gax/httpjson/HttpJsonStatusCode.java#L96-L133 + // Therefore, just setting the error code to `Code.UNKNOWN` for httpJson will get translated + // instead to `Code.INTERNAL`. + Set retryableCodes = ImmutableSet.of(Code.UNKNOWN, Code.INTERNAL); + + // Create gRPC Interceptor and Client + grpcRequestInterceptor = new ITAutoPopulatedFields.GRPCInterceptor(); + grpcClientWithoutRetries = + TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcRequestInterceptor)); + grpcClientWithRetries = + TestClientInitializer.createGrpcEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(grpcRequestInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new ITAutoPopulatedFields.HttpJsonInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + httpJsonClientWithRetries = + TestClientInitializer.createHttpJsonEchoClientWithRetrySettings( + defaultRetrySettings, retryableCodes, ImmutableList.of(httpJsonInterceptor)); + } + + @AfterEach + void destroyClient() throws InterruptedException { + grpcClientWithoutRetries.close(); + grpcClientWithRetries.close(); + httpJsonClient.close(); + + grpcClientWithoutRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testGrpc_shouldNotAutoPopulateRequestIdIfSetInRequest() { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + grpcClientWithoutRetries.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testHttpJson_autoPopulateRequestIdWhenAttemptedOnceSuccessfully() { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + // Autopopulation of UUID is currently only configured for format UUID4. + Integer UUIDVersion = 4; + Truth.assertThat(UUID.fromString(capturedRequestIds.get(0)).version()).isEqualTo(UUIDVersion); + } + + @Test + void testHttpJson_shouldNotAutoPopulateRequestIdIfSetInRequest() { + String UUIDsent = UUID.randomUUID().toString(); + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + httpJsonClient.echo(EchoRequest.newBuilder().setRequestId(UUIDsent).build()); + Truth.assertThat(capturedRequestIds).isNotEmpty(); + Truth.assertThat(capturedRequestIds).contains(UUIDsent); + } + + @Test + void testGRPC_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + grpcRequestInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.ordinal()).build()) + .build(); + + try { + RetryingFuture retryingFuture = + (RetryingFuture) + grpcClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + grpcClientWithRetries.close(); + grpcClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameRequestIdIfSetInRequestWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + String UUIDsent = UUID.randomUUID().toString(); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setRequestId(UUIDsent) + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same as the UUIDSent + Truth.assertThat(capturedRequestIds) + .containsExactly(UUIDsent, UUIDsent, UUIDsent, UUIDsent, UUIDsent); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_setsSameAutoPopulatedRequestIdWhenRequestsAreRetried() throws Exception { + List capturedRequestIds = new ArrayList<>(); + httpJsonInterceptor.setOnRequestIntercepted( + request -> { + if (request instanceof EchoRequest) { + EchoRequest echoRequest = (EchoRequest) request; + capturedRequestIds.add(echoRequest.getRequestId()); + } + }); + EchoRequest requestSent = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(Code.UNKNOWN.getHttpStatusCode()).build()) + .build(); + try { + RetryingFuture retryingFuture = + (RetryingFuture) + httpJsonClientWithRetries.echoCallable().futureCall(requestSent); + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + // assert that the number of request IDs is equal to the max attempt + Truth.assertThat(capturedRequestIds).hasSize(5); + // assert that each request ID sent is the same + Truth.assertThat(capturedRequestIds) + .containsExactly( + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0), + capturedRequestIds.get(0)); + } finally { + httpJsonClientWithRetries.close(); + httpJsonClientWithRetries.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java new file mode 100644 index 0000000000..72b8f1b0de --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITBidiStreaming.java @@ -0,0 +1,107 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ClientStream; +import com.google.api.gax.rpc.ResponseObserver; +import com.google.api.gax.rpc.StreamController; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITBidiStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws Exception { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // The current implementation of BIDI streaming on Echo showcase server is that it would echo the + // request content back on every request, so this test verifies that the response content is + // exactly the same as request content. + // Ideally we should make the BIDI streaming server more generic, e.g. only respond when there are + // three requests, respond twice for every request etc. If that happens, the response content may + // not be exactly the same as request content. + @Test + void testGrpc_splitCall_shouldListensToResponse() throws Exception { + // given + List expected = Arrays.asList("The rain in Spain stays mainly on the plain".split(" ")); + TestResponseObserver responseObserver = new TestResponseObserver(); + + // when + ClientStream clientStream = grpcClient.chatCallable().splitCall(responseObserver); + expected.forEach( + requestContent -> { + EchoRequest request = EchoRequest.newBuilder().setContent(requestContent).build(); + clientStream.send(request); + }); + clientStream.closeSend(); + + // then + List actual = responseObserver.getFuture().get(); + assertThat(actual).containsExactlyElementsIn(expected).inOrder(); + } + + private static class TestResponseObserver implements ResponseObserver { + private final List responses = new ArrayList<>(); + private final SettableApiFuture> future = SettableApiFuture.create(); + + @Override + public void onStart(StreamController controller) { + // no-op + } + + @Override + public void onResponse(EchoResponse response) { + responses.add(response.getContent()); + } + + @Override + public void onError(Throwable t) { + // no-op + } + + @Override + public void onComplete() { + future.set(responses); + } + + public SettableApiFuture> getFuture() { + return future; + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java new file mode 100644 index 0000000000..e55ee8d1ed --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientShutdown.java @@ -0,0 +1,163 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.threeten.bp.Duration; + +class ITClientShutdown { + + private static final long DEFAULT_RPC_TIMEOUT_MS = 15000L; + private static final long DEFAULT_CLIENT_TERMINATION_MS = 5000L; + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testGrpc_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate properly + @Test + @Timeout(15) + void testHttpJson_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + assertClientTerminated(httpjsonClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testGrpc_rpcInvoked_closeClient() throws Exception { + EchoClient grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Response is ignored for this test + grpcClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(grpcClient); + } + + // Test to ensure the client can close + terminate after a quick RPC invocation + @Test + @Timeout(15) + void testHttpJson_rpcInvoked_closeClient() throws Exception { + EchoClient httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + // Response is ignored for this test + httpjsonClient.echo(EchoRequest.newBuilder().setContent("Test").build()); + assertClientTerminated(httpjsonClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testGrpc_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + grpcClient.block(blockRequest); + + assertClientTerminated(grpcClient); + } + + // This test is to ensure that the client is able to close + terminate any resources + // once a response has been received. Set a max test duration of 15s to ensure that + // the test does not continue on forever. + @Test + @Timeout(15) + void testHttpJson_rpcInvokedWithLargeTimeout_closeClientOnceResponseReceived() throws Exception { + // Set the maxAttempts to 1 to ensure there are no retries scheduled. The single RPC + // invocation should time out in 15s, but the client will receive a response in 2s. + // Any outstanding tasks (timeout tasks) should be cancelled once a response has been + // received so the client can properly terminate. + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxRpcTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setTotalTimeout(Duration.ofMillis(DEFAULT_RPC_TIMEOUT_MS)) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + + // Response is ignored for this test + httpjsonClient.block(blockRequest); + + assertClientTerminated(httpjsonClient); + } + + // This helper method asserts that the client is able to terminate within + // `AWAIT_TERMINATION_SECONDS` + private void assertClientTerminated(EchoClient echoClient) throws InterruptedException { + long start = System.currentTimeMillis(); + // Intentionally do not run echoClient.awaitTermination(...) as this test will + // check that everything is properly terminated after close() is called. + echoClient.close(); + + // Loop until the client has terminated successfully. For tests that use this, + // try to ensure there is a timeout associated, otherwise this may run forever. + // Future enhancement: Use awaitility instead of busy waiting + while (!echoClient.isTerminated()) { + Thread.sleep(500L); + } + // The busy-wait time won't be accurate, so account for a bit of buffer + long end = System.currentTimeMillis(); + + Truth.assertThat(echoClient.isShutdown()).isTrue(); + + // Check the termination time. If all the tasks/ resources are closed successfully, + // the termination time should only occur shortly after `close()` was invoked. The + // `DEFAULT_TERMINATION_MS` value should include a bit of buffer. + long terminationTime = end - start; + Truth.assertThat(terminationTime).isLessThan(DEFAULT_CLIENT_TERMINATION_MS); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java new file mode 100644 index 0000000000..61b507f49a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITClientSideStreaming.java @@ -0,0 +1,123 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.rpc.ApiStreamObserver; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITClientSideStreaming { + + private static EchoClient grpcClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_sendStreamedContent_receiveConcatenatedResponse() + throws ExecutionException, InterruptedException { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + requestObserver.onCompleted(); + + List serverResponse = responseObserver.future().get(); + assertThat(serverResponse).hasSize(1); + assertThat(serverResponse.get(0).getContent()) + .isEqualTo("The rain in Spain stays mainly on the plain"); + } + + @Test + void testGrpc_sendStreamedContent_handleServerError() { + CollectStreamObserver responseObserver = new CollectStreamObserver<>(); + ApiStreamObserver requestObserver = + grpcClient.collectCallable().clientStreamingCall(responseObserver); + String content = "The rain in Spain stays mainly on the plain"; + for (String message : content.split("\\s")) { + requestObserver.onNext(EchoRequest.newBuilder().setContent(message).build()); + } + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + requestObserver.onNext(EchoRequest.newBuilder().setError(cancelledStatus).build()); + requestObserver.onCompleted(); + + ExecutionException exception = + assertThrows(ExecutionException.class, () -> responseObserver.future().get()); + assertThat(exception.getCause()).isInstanceOf(CancelledException.class); + CancelledException cancelledException = (CancelledException) exception.getCause(); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + /** + * Implementation of {@link ApiStreamObserver} to accumulate streamed content. + * + * @param + */ + private class CollectStreamObserver implements ApiStreamObserver { + + private final SettableApiFuture> future = SettableApiFuture.create(); + private final List messages = new ArrayList<>(); + + @Override + public void onNext(T message) { + this.messages.add(message); + } + + @Override + public void onError(Throwable throwable) { + this.future.setException(throwable); + } + + @Override + public void onCompleted() { + future.set(this.messages); + } + + public SettableApiFuture> future() { + return this.future; + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java new file mode 100644 index 0000000000..a64f95a258 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCommonServiceMixins.java @@ -0,0 +1,133 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; + +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITCommonServiceMixins { + + // The showcase server always returns a fixed list of locations. See + // https://github.com/googleapis/gapic-showcase/blob/main/server/services/locations_service.go + private static final List EXPECTED_LOCATIONS = + ImmutableList.of( + Location.newBuilder() + .setName("projects/showcase/locations/us-north") + .setDisplayName("us-north") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-south") + .setDisplayName("us-south") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-east") + .setDisplayName("us-east") + .build(), + Location.newBuilder() + .setName("projects/showcase/locations/us-west") + .setDisplayName("us-west") + .build()); + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + + // Create HttpJson Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/location/us-central1").build(); + Location location = grpcClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/location/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testGrpc_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + grpcClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } + + @Test + void testHttpJson_getLocation() { + GetLocationRequest request = + GetLocationRequest.newBuilder().setName("projects/showcase/locations/us-central1").build(); + Location location = httpjsonClient.getLocation(request); + assertThat(location) + .isEqualTo( + Location.newBuilder() + .setName("projects/showcase/locations/us-central1") + .setDisplayName("us-central1") + .build()); + } + + @Test + void testHttpJson_listLocations() { + ListLocationsRequest request = + ListLocationsRequest.newBuilder().setName("projects/showcase").build(); + EchoClient.ListLocationsPagedResponse locationsPagedResponse = + httpjsonClient.listLocations(request); + + List actualLocations = new ArrayList<>(); + for (Location location : locationsPagedResponse.iterateAll()) { + actualLocations.add(location); + } + + assertThat(actualLocations).containsExactlyElementsIn(EXPECTED_LOCATIONS).inOrder(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java new file mode 100644 index 0000000000..bfb9e335e5 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITCrud.java @@ -0,0 +1,189 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; + +import com.google.common.collect.ImmutableList; +import com.google.protobuf.FieldMask; +import com.google.showcase.v1beta1.CreateUserRequest; +import com.google.showcase.v1beta1.DeleteUserRequest; +import com.google.showcase.v1beta1.IdentityClient; +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 com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITCrud { + + private static final User DEFAULT_USER = + User.newBuilder() + .setDisplayName("Jane Doe") + .setEmail("janedoe@example.com") + .setNickname("Doe") + .setHeightFeet(5) + .setAge(25) + .build(); + + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + + @BeforeAll + public static void createClients() throws Exception { + // Create gRPC IdentityClient + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + // Create HttpJson IdentityClient + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @BeforeEach + void cleanupData() { + IdentityClient.ListUsersPagedResponse pagedResponse = + grpcClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + for (IdentityClient.ListUsersPage listUsersPage : pagedResponse.iteratePages()) { + for (User user : listUsersPage.getResponse().getUsersList()) { + grpcClient.deleteUser(user.getName()); + } + } + pagedResponse = httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(pagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + @Test + void testHttpJson_Create() { + User userResponse = createDefaultUser(); + + // These properties should be the same + assertThat(userResponse.getDisplayName()).isEqualTo(DEFAULT_USER.getDisplayName()); + assertThat(userResponse.getEmail()).isEqualTo(DEFAULT_USER.getEmail()); + assertThat(userResponse.getNickname()).isEqualTo(DEFAULT_USER.getNickname()); + assertThat(userResponse.getHeightFeet()).isEqualTo(DEFAULT_USER.getHeightFeet()); + assertThat(userResponse.getAge()).isEqualTo(DEFAULT_USER.getAge()); + + // Assert that the server populates these fields + assertThat(userResponse.getName()).isNotEmpty(); + assertThat(userResponse.getCreateTime()).isNotNull(); + assertThat(userResponse.getUpdateTime()).isNotNull(); + assertThat(userResponse.getEnableNotifications()).isNotNull(); + } + + @Test + void testHttpJson_Read() { + List expectedUsersList = + ImmutableList.of( + createDefaultUser(), + createUser( + DEFAULT_USER.toBuilder() + .setNickname("John Smith") + .setEmail("johnsmith@example.com") + .build())); + // Assert that only one User exists + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + ListUsersResponse listUsersResponse = listUsersPagedResponse.getPage().getResponse(); + assertThat(listUsersResponse.getUsersList().size()).isEqualTo(2); + + // Check that the response from both List (pagination) and Get + // List Users + assertThat(listUsersResponse.getUsersList()).containsExactlyElementsIn(expectedUsersList); + + // Get User + User defaultUser = expectedUsersList.get(0); + User getUserResponse = httpjsonClient.getUser(defaultUser.getName()); + assertThat(getUserResponse).isEqualTo(defaultUser); + } + + @Test + void testHttpJson_Update() { + User userResponse = createDefaultUser(); + // Update multiple fields in the User. Age + Nickname are not included in the FieldMask + // userResponse's enableNotifications field is populated from the server + User updateUser = + userResponse.toBuilder() + .setAge(50) + .setNickname("Smith") + .setEmail("janedoe@jane.com") + .setHeightFeet(6.0) + .setEnableNotifications(true) + .build(); + User updateUserResponse = + httpjsonClient.updateUser( + UpdateUserRequest.newBuilder() + .setUser(updateUser) + .setUpdateMask( + FieldMask.newBuilder() + .addAllPaths(Arrays.asList("email", "height_feet", "enable_notifications")) + .build()) + .build()); + + // Assert that only the fields in the FieldMask are updated correctly + assertThat(updateUserResponse).isNotEqualTo(userResponse); + assertThat(updateUserResponse.getAge()).isEqualTo(userResponse.getAge()); + assertThat(updateUserResponse.getNickname()).isEqualTo(userResponse.getNickname()); + + assertThat(updateUserResponse.getEmail()).isEqualTo(updateUser.getEmail()); + assertThat(updateUserResponse.getHeightFeet()).isEqualTo(updateUser.getHeightFeet()); + assertThat(updateUserResponse.getEnableNotifications()) + .isEqualTo(updateUser.getEnableNotifications()); + } + + @Test + void testHttpJson_Delete() { + User userResponse = createDefaultUser(); + + httpjsonClient.deleteUser( + DeleteUserRequest.newBuilder().setName(userResponse.getName()).build()); + + IdentityClient.ListUsersPagedResponse listUsersPagedResponse = + httpjsonClient.listUsers(ListUsersRequest.newBuilder().setPageSize(5).build()); + assertThat(listUsersPagedResponse.getPage().getResponse().getUsersList().size()).isEqualTo(0); + } + + private User createDefaultUser() { + return createUser(DEFAULT_USER); + } + + /** + * Helper method to create a user with the DEFAULT_USER configs. Server returns a generated name + * (not username) that is used to identify the individual user and each test uses the name for the + * RPC. Server also populates a few additional fields (Create Time, Updated Time, and Enable + * Notifications). + * + * @param user User to be created + * @return newly created user + */ + private User createUser(User user) { + return httpjsonClient.createUser(CreateUserRequest.newBuilder().setUser(user).build()); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java new file mode 100644 index 0000000000..7828da8b53 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITDynamicRoutingHeaders.java @@ -0,0 +1,400 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.api.gax.rpc.internal.Headers.DYNAMIC_ROUTING_HEADER_KEY; +import static com.google.common.truth.Truth.assertThat; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITDynamicRoutingHeaders { + private static final String SPLIT_TOKEN = "&"; + private static final Metadata.Key REQUEST_PARAMS_HEADER_KEY = + Metadata.Key.of(DYNAMIC_ROUTING_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + // Implement a request interceptor to retrieve the headers being sent on the request. + // The headers being set are part of the Metadata + private static class GrpcCapturingClientInterceptor implements ClientInterceptor { + private Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(ClientCall.Listener responseListener, Metadata headers) { + metadata = headers; + super.start(responseListener, headers); + } + }; + } + } + + // Implement a request interceptor to retrieve the headers being sent on the request + // The headers being set are part of the CallOptions + private static class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + private String requestParam; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall< + RequestT, ResponseT>(call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + if (requestHeaders.getHeaders().containsKey(DYNAMIC_ROUTING_HEADER_KEY)) { + requestParam = + String.valueOf(requestHeaders.getHeaders().get(DYNAMIC_ROUTING_HEADER_KEY)); + } + } + }; + } + } + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client because echo client doesn't have an implicit enum routing test + // case + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + } + + @BeforeEach + void cleanUpParams() { + grpcInterceptor.metadata = null; + grpcComplianceInterceptor.metadata = null; + httpJsonInterceptor.requestParam = null; + httpJsonComplianceInterceptor.requestParam = null; + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + grpcComplianceClient.close(); + + httpJsonClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_noRoutingHeaderUsed() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_noRoutingHeaderUsed() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_emptyHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNull(); + } + + @Test + void testHttpJson_emptyHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNull(); + } + + @Test + void testGrpc_matchesHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFKingdomValue(5)).build(); + RepeatResponse actualResponse = grpcComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // fields beside "info.f_kingdom" are default values (false, 0.0, 0) since we are not setting + // them in the request message. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=false", "info.f_double=0.0", "info.f_int32=0", "info.f_kingdom=5"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_implicitHeaders_enumsEncodedasInt() { + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo( + ComplianceData.newBuilder() + .setFString("test") + .setFInt32(1) + .setFDouble(2) + .setFBool(true) + .setFKingdomValue(3)) + .build(); + RepeatResponse actualResponse = httpJsonComplianceClient.repeatDataSimplePath(request); + String headerValue = httpJsonComplianceInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + // In this case, we are setting the values explicitly. + List expectedHeaders = + ImmutableList.of( + "info.f_bool=true", + "info.f_double=2.0", + "info.f_int32=1", + "info.f_kingdom=3", + "info.f_string=test"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("potato").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("header=potato", "routing_id=potato"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesOtherHeaderName() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesOtherHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().setOtherHeader("instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = ImmutableList.of("baz=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesHeader() { + grpcClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesHeader() { + httpJsonClient.echo(EchoRequest.newBuilder().setHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "header=projects%2F123%2Finstances%2F456", + "routing_id=projects%2F123%2Finstances%2F456", + "super_id=projects%2F123", + "table_name=projects%2F123%2Finstances%2F456", + "instance_id=instances%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders).inOrder(); + } + + @Test + void testGrpc_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + grpcClient.echo(EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleOfSameRoutingHeader_usesOtherHeader() { + httpJsonClient.echo( + EchoRequest.newBuilder().setOtherHeader("projects/123/instances/456").build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of("baz=projects%2F123%2Finstances%2F456", "qux=projects%2F123"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testGrpc_matchesMultipleRoutingHeaders() { + grpcClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = grpcInterceptor.metadata.get(REQUEST_PARAMS_HEADER_KEY); + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } + + @Test + void testHttpJson_matchesMultipleRoutingHeaders() { + httpJsonClient.echo( + EchoRequest.newBuilder() + .setHeader("regions/123/zones/456") + .setOtherHeader("projects/123/instances/456") + .build()); + String headerValue = httpJsonInterceptor.requestParam; + assertThat(headerValue).isNotNull(); + List requestHeaders = + Arrays.stream(headerValue.split(SPLIT_TOKEN)).collect(Collectors.toList()); + List expectedHeaders = + ImmutableList.of( + "baz=projects%2F123%2Finstances%2F456", + "qux=projects%2F123", + "table_name=regions%2F123%2Fzones%2F456", + "header=regions%2F123%2Fzones%2F456", + "routing_id=regions%2F123%2Fzones%2F456"); + assertThat(requestHeaders).containsExactlyElementsIn(expectedHeaders); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java new file mode 100644 index 0000000000..0f50051b68 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITEndpointContext.java @@ -0,0 +1,469 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.CredentialsProvider; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.UnauthenticatedException; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GoogleCredentials; +import com.google.common.truth.Truth; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import java.io.IOException; +import java.net.URI; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +/** + * This IT tests the different user configurations allowed and their effects on endpoint and + * universe domain resolution. + * + *

In these tests, the client is not initialized with the default configuration: + * `EchoClient.create()`. For showcase tests run in CI, the client must be supplied explicitly + * supplied with a Credentials value. The tests use a wrapped Credentials and Credentials Provider + * (UniverseDomainCredentials and UniverseDomainCredentialsProvider) which allow for testing this. + * + *

Endpoint resolution has the same behavior for both gRPC and HttpJson. The showcase tests below + * only use the gRPC transport for testing. HttpJson functionality exists inside the wrapper + * classes, but is not being used. + */ +class ITEndpointContext { + /** + * Inside the test cases below, we must explicitly configure serviceName. Normally this should not + * be configured at all, but showcase clients do not have a serviceName. The ExtendStubSettings + * wrapper return the serviceName by overriding the `getServiceName()` result. + */ + private static class ExtendedEchoStubSettings extends EchoStubSettings { + + private static final String DUMMY_MTLS_ENDPOINT = "mtls.googleapis.com:443"; + + protected ExtendedEchoStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + @Override + public String getServiceName() { + return "test"; + } + + public static ExtendedEchoStubSettings.Builder newBuilder() { + return ExtendedEchoStubSettings.Builder.createDefault(); + } + + public static ExtendedEchoStubSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoStubSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoStubSettings.Builder { + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + private static ExtendedEchoStubSettings.Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + private static ExtendedEchoStubSettings.Builder createHttpJsonDefault() { + Builder builder = new Builder(((ClientContext) null)); + builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(DUMMY_MTLS_ENDPOINT); + builder.setSwitchToMtlsEndpointAllowed(true); + return builder; + } + + @Override + public ExtendedEchoStubSettings build() throws IOException { + return new ExtendedEchoStubSettings(this); + } + } + } + + /** + * Without this ClientSettings wrapper, we must expose a serviceName setter to + * (Client|Stub)Settings and pass the StubSettings to the client. However, this will result in a + * null ClientSettings (See {@link EchoClient#create(EchoStub)}). Passing the stub to the Client + * will result in a NPE when doing `Client.getSettings().get(Endpoint|UniverseDomain)` as the + * ClientSettings is stored as null. + */ + private static class ExtendedEchoSettings extends EchoSettings { + + protected ExtendedEchoSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + public static EchoSettings.Builder newBuilder() { + return ExtendedEchoSettings.Builder.createDefault(); + } + + public static EchoSettings.Builder newHttpJsonBuilder() { + return ExtendedEchoSettings.Builder.createHttpJsonDefault(); + } + + public static class Builder extends EchoSettings.Builder { + protected Builder() throws IOException {} + + private static ExtendedEchoSettings.Builder createDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newBuilder()); + } + + private static ExtendedEchoSettings.Builder createHttpJsonDefault() { + return new ExtendedEchoSettings.Builder(ExtendedEchoStubSettings.newHttpJsonBuilder()); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + } + + protected Builder(EchoSettings settings) { + super(settings); + } + + protected Builder(ExtendedEchoStubSettings.Builder stubSettings) { + super(stubSettings); + } + } + } + + /** + * Credentials Wrapper for showcase testing which is used to override the Universe Domain value. + * + *

For the tests below, it will act as a valid Credentials and is used to test the flows where + * the user passes in a Credentials (i.e. ServiceAccount, AccessToken, Oauth, etc.) + */ + private static class UniverseDomainCredentials extends Credentials { + + private final String universeDomain; + + private UniverseDomainCredentials(String universeDomain) { + this.universeDomain = universeDomain; + } + + @Override + public String getAuthenticationType() { + return null; + } + + @Override + public Map> getRequestMetadata(URI uri) { + return new HashMap<>(); + } + + @Override + public boolean hasRequestMetadata() { + return false; + } + + @Override + public boolean hasRequestMetadataOnly() { + return false; + } + + @Override + public void refresh() { + // no-op + } + + @Override + public String getUniverseDomain() { + return universeDomain; + } + } + + /** + * CredentialsProvider wrapper to return the wrapped Universe Domain Credentials. This will return + * the custom Universe Domain value. + */ + private static class UniverseDomainCredentialsProvider implements CredentialsProvider { + + private final String universeDomain; + + public UniverseDomainCredentialsProvider(String universeDomain) { + this.universeDomain = universeDomain; + } + + public static UniverseDomainCredentialsProvider create() { + return new UniverseDomainCredentialsProvider(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + public static UniverseDomainCredentialsProvider create(String universeDomain) { + return new UniverseDomainCredentialsProvider(universeDomain); + } + + @Override + public Credentials getCredentials() { + return new UniverseDomainCredentials(universeDomain); + } + } + + private static final String DEFAULT_ENDPOINT = "test.googleapis.com:443"; + private static final EchoRequest DEFAULT_REQUEST = + EchoRequest.newBuilder().setContent("echo").build(); + + private EchoClient echoClient; + + @AfterEach + void cleanup() throws InterruptedException { + if (echoClient != null) { + echoClient.close(); + echoClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Default (no configuration) + @Test + void endpointResolution_default() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(DEFAULT_ENDPOINT); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + // User configuration + @Test + void endpointResolution_userSetEndpoint() throws IOException { + String customEndpoint = "test.com:123"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()) + .isEqualTo(GoogleCredentials.GOOGLE_DEFAULT_UNIVERSE); + } + + @Test + void endpointResolution_userSetUniverseDomainAndNoUserSetEndpoint() throws IOException { + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // If user configured the universe domain, the endpoint is constructed from it + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo("test.random.com:443"); + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void endpointResolution_userSetEndpointAndUniverseDomain() throws IOException { + String customEndpoint = "custom.endpoint.com:443"; + String customUniverseDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(customEndpoint) + .setUniverseDomain(customUniverseDomain) + .build(); + echoClient = EchoClient.create(echoSettings); + // Custom Endpoint sets the endpoint for the client to use + Truth.assertThat(echoClient.getSettings().getEndpoint()).isEqualTo(customEndpoint); + // The universe domain doesn't match the endpoint. The call will fail validation when RPC is + // called. + Truth.assertThat(echoClient.getSettings().getUniverseDomain()).isEqualTo(customUniverseDomain); + } + + @Test + void universeDomainValidation_credentialsGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDU_noUserConfiguration() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create("random.com")) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (googleapis.com) does not match the universe domain" + + " found in the credentials (random.com)."); + } + + @Test + void universeDomainValidation_credentialsNonGDUMatchesUserConfiguration() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + @Test + void universeDomainValidation_credentialsNonGDUDoesNotMatchUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + String userConfigurationUniverseDomain = "test.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(userConfigurationUniverseDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (test.com) does not match the universe domain found in" + + " the credentials (random.com)."); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_noUserSetUniverseDomain() throws IOException { + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + // Does not throw an error + echoClient.echo(DEFAULT_REQUEST); + } + + // This test uses NoCredentialsProvider (will default to GDU) + @Test + void universeDomainValidation_noCredentials_userSetUniverseDomain() throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + + UnauthenticatedException exception = + assertThrows(UnauthenticatedException.class, () -> echoClient.echo(DEFAULT_REQUEST)); + Truth.assertThat(exception.getMessage()) + .contains( + "The configured universe domain (random.com) does not match the universe domain found" + + " in the credentials (googleapis.com)."); + } + + // Default in Builder (no configuration) + @Test + void endpointResolution_defaultViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder(); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo(null); + } + + // User configuration in Builder + @Test + void endpointResolution_userConfigurationViaBuilder() { + EchoSettings.Builder echoSettingsBuilder = + EchoSettings.newBuilder().setEndpoint("test.com:123"); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoSettingsBuilder.getEndpoint()).isEqualTo("test.com:123"); + } + + @Test + void endpointResolution_builderBuilderBackToBuilder() throws IOException { + String customEndpoint = "test.com:123"; + EchoStubSettings.Builder echoStubSettingsBuilder = + EchoStubSettings.newBuilder().setEndpoint(customEndpoint); + // `StubSettings.newBuilder()` will return the clientSettingsEndpoint + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + + // EndpointContext is recomputed when the Builder is re-built + EchoStubSettings echoStubSettings = echoStubSettingsBuilder.build(); + Truth.assertThat(echoStubSettings.getEndpoint()).isEqualTo(customEndpoint); + + // Calling toBuilder on StubSettings keeps the configurations the same + echoStubSettingsBuilder = echoStubSettings.toBuilder(); + Truth.assertThat(echoStubSettingsBuilder.getEndpoint()).isEqualTo(customEndpoint); + } + + @Test + void universeDomainValidation_quotaProjectId_credentialsNonGDUMatchesUserConfiguration() + throws IOException { + String universeDomain = "random.com"; + EchoSettings echoSettings = + ExtendedEchoSettings.newBuilder() + .setQuotaProjectId("exampleProject") + .setCredentialsProvider(UniverseDomainCredentialsProvider.create(universeDomain)) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .setUniverseDomain(universeDomain) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .build(); + echoClient = EchoClient.create(echoSettings); + Truth.assertThat(echoClient.echo(DEFAULT_REQUEST).getContent()).isEqualTo("echo"); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java new file mode 100644 index 0000000000..f043d45cfc --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITGdch.java @@ -0,0 +1,224 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static com.google.common.truth.Truth.assertWithMessage; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.client.json.GenericJson; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.auth.Credentials; +import com.google.auth.oauth2.GdchCredentials; +import com.google.auth.oauth2.GdchCredentialsTestUtil; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.InterceptingMockTokenServerTransportFactory; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +/** + * Test suite to confirm a client can be instantiated with GDCH credentials. No calls are made since + * it is not feasible to test against real GDCH servers (or replicate an environment) + */ +class ITGdch { + + private static final String CA_CERT_FILENAME = "fake_cert.pem"; + private static final String CA_CERT_RESOURCE_PATH = "/" + CA_CERT_FILENAME; + private static final String CA_CERT_JSON_KEY = "ca_cert_path"; + private static final String GDCH_CREDENTIAL_FILENAME = "test_gdch_credential.json"; + private static final String GDCH_CREDENTIAL_RESOURCE_PATH = "/" + GDCH_CREDENTIAL_FILENAME; + private static final String GDCH_TOKEN_STRING = "1/MkSJoj1xsli0AccessToken_NKPY2"; + private static final String SID_NAME = "service-identity-name"; + + private EchoClient client; + private EchoSettings settings; + private EchoStubSettings stubSettings; + private Credentials initialCredentials; + private ClientContext context; + private InterceptingMockTokenServerTransportFactory transportFactory; + private String projectId; + private URI tokenUri; + + @BeforeEach + void setup(@TempDir Path tempDir) throws IOException { + transportFactory = new InterceptingMockTokenServerTransportFactory(); + prepareCredentials(tempDir); + settings = + EchoSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(initialCredentials)) + .build(); + } + + @AfterEach + void tearDown() throws InterruptedException { + if (client != null) { + client.close(); + client.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + private void prepareCredentials(Path tempDir) throws IOException { + // Copy file so it can be referenced by Path even in native-image builds + File caCertFile = new File(tempDir.toFile(), CA_CERT_FILENAME); + try (InputStream inputStream = getClass().getResourceAsStream(CA_CERT_RESOURCE_PATH)) { + assertThat(inputStream).isNotNull(); + Files.copy(inputStream, caCertFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } + assertWithMessage(caCertFile.toPath() + " should exist").that(caCertFile.exists()).isTrue(); + + // open gdch credential json (still needs its "ca_cert_path" to point to the CA certificate + // obtained from above) + JsonFactory factory = new GsonFactory(); + GenericJson converted = + factory.fromInputStream( + getClass().getResourceAsStream(GDCH_CREDENTIAL_RESOURCE_PATH), GenericJson.class); + + // modify and save to a temporary folder + converted.set(CA_CERT_JSON_KEY, caCertFile.toPath().toAbsolutePath().toString()); + projectId = converted.get("project").toString(); + tokenUri = URI.create(converted.get("token_uri").toString()); + + File tempGdchCredentialFile = new File(tempDir.toFile(), GDCH_CREDENTIAL_FILENAME); + try (FileWriter fileWriter = new FileWriter(tempGdchCredentialFile)) { + String preparedJson = converted.toPrettyString(); + fileWriter.write(preparedJson); + } + + // use temp location to instantiate credentials + initialCredentials = GdchCredentialsTestUtil.fromJson(converted, transportFactory); + } + + /** + * {@link com.google.api.gax.rpc.ClientContext} will create a new {@link GdchCredentials} with an + * audience defaulted to the endpoint if the audience is not manually passed. This test confirms + * that a new credential is created from the context and can be refreshed + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialAndNoAudience_defaultsToEndpointBasedAudience() + throws IOException { + + // we create the client as usual - no audience passed + String testEndpoint = "custom-endpoint:123"; + settings = settings.toBuilder().setEndpoint(testEndpoint).build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve from context and from client + // the client has only access to creds provider, which may differ from the actual credentials + // used in the Context + Credentials fromContext = context.getCredentials(); + Credentials fromClient = initialCredentials; + + // Since ClientContext.create() uses a modified version of GdchCredentials + // via GdchCredentials.createWithGdchAudience(), they should be different objects + assertNotSame(fromContext, fromClient); + + // When credentials don't have an audience (such as the ones we passed to client creation and + // now stored in the + // provider) they will throw if we try to refresh them + NullPointerException expectedEx = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + expectedEx.getMessage().contains("Audience are not configured for GDCH service account")); + + // However, the credentials prepared in ClientContext should be able to refresh since the + // audience would be + // internally defaulted the endpoint of the StubSettings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testEndpoint, usedAudience); + } + + /** + * Confirms creating a client with a valid audience is successful. We cannot confirm which + * audience is chosen (our passed audience or the endpoint) but this is confirmed in the unit + * tests. + * + * @throws IOException + */ + @Test + void testCreateClient_withGdchCredentialWithValidAudience_usesCredentialWithPassedAudience() + throws IOException { + + // Similar to the previous test, create a client as usual but this time we pass a explicit + // audience. It should + // be created without issues + String testAudience = "valid-audience"; + settings = + settings.toBuilder().setGdchApiAudience(testAudience).setEndpoint("localhost:7469").build(); + context = ClientContext.create(settings); + stubSettings = EchoStubSettings.newBuilder(context).build(); + client = EchoClient.create(stubSettings.createStub()); + + // We retrieve both creds from the creds provider and the ones prepared in the context (which + // should have been + // re-created using GdchCredentials.createWithAudience("valid-audience")) + Credentials fromContext = context.getCredentials(); + assertNotSame(fromContext, initialCredentials); + + // Again, since the initial credentials don't have an audience, we should not be able to refresh + // them + NullPointerException thrownByClientCreds = + assertThrows(NullPointerException.class, () -> initialCredentials.refresh()); + assertTrue( + thrownByClientCreds + .getMessage() + .contains("Audience are not configured for GDCH service account")); + + // But the credentials prepared in ClientContext should be able to refresh since the audience + // would be internally + // set to the one passed in stub settings + registerCredential(fromContext); + ((GdchCredentials) fromContext).refreshAccessToken(); + String usedAudience = transportFactory.transport.getLastAudienceSent(); + assertEquals(testAudience, usedAudience); + } + + private void registerCredential(Credentials fromContext) { + GdchCredentialsTestUtil.registerGdchCredentialWithMockTransport( + (GdchCredentials) fromContext, + transportFactory.transport, + projectId, + SID_NAME, + GDCH_TOKEN_STRING, + tokenUri); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java new file mode 100644 index 0000000000..0daf858d14 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITHttpAnnotation.java @@ -0,0 +1,145 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.util.JsonFormat; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.ComplianceGroup; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.ComplianceSuite; +import com.google.showcase.v1beta1.RepeatRequest; +import com.google.showcase.v1beta1.RepeatResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.security.GeneralSecurityException; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +// This test runs from the parameters in the compliance_suite.json file +// The file is downloaded from the gapic-showcase repo. Each compliance +// group is a set of HttpJson behaviors we want to test for. Each group +// tests the product of the rpc list and requests list. +class ITHttpAnnotation { + + static Stream data() { + return Stream.of( + Arguments.of("Fully working conversions, resources"), + Arguments.of("Binding selection testing"), + Arguments.of("Cases that apply to non-path requests"), + Arguments.of("Fully working conversions, no resources")); + } + + private static ComplianceClient httpjsonClient; + private static ComplianceSuite complianceSuite; + private static Map> validComplianceRpcMap; + + @BeforeAll + static void createClients() throws IOException, GeneralSecurityException { + ComplianceSuite.Builder builder = ComplianceSuite.newBuilder(); + JsonFormat.parser() + .merge( + new InputStreamReader( + Objects.requireNonNull( + ITHttpAnnotation.class + .getClassLoader() + .getResourceAsStream("compliance_suite.json")), + StandardCharsets.UTF_8), + builder); + complianceSuite = builder.build(); + + ComplianceSettings httpjsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + httpjsonClient = ComplianceClient.create(httpjsonComplianceSettings); + + // Mapping of Compliance Suite file RPC Names to ComplianceClient methods + validComplianceRpcMap = + ImmutableMap.of( + "Compliance.RepeatDataBody", + httpjsonClient::repeatDataBody, + "Compliance.RepeatDataBodyInfo", + httpjsonClient::repeatDataBodyInfo, + "Compliance.RepeatDataQuery", + httpjsonClient::repeatDataQuery, + "Compliance.RepeatDataSimplePath", + httpjsonClient::repeatDataSimplePath, + "Compliance.RepeatDataBodyPut", + httpjsonClient::repeatDataBodyPut, + "Compliance.RepeatDataBodyPatch", + httpjsonClient::repeatDataBodyPatch, + "Compliance.RepeatDataPathResource", + httpjsonClient::repeatDataPathResource); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // Verify that the input's info is the same as the response's info + // This ensures that the entire group's behavior over HttpJson + // works as intended + @ParameterizedTest + @MethodSource("data") + void testComplianceGroup(String groupName) { + Optional complianceGroupOptional = + complianceSuite.getGroupList().stream() + .filter(x -> x.getName().equals(groupName)) + .findFirst(); + assertThat(complianceGroupOptional.isPresent()).isTrue(); + ComplianceGroup complianceGroup = complianceGroupOptional.get(); + List validRpcList = + complianceGroup.getRpcsList().stream() + .filter(validComplianceRpcMap::containsKey) + .collect(Collectors.toList()); + for (String rpcName : validRpcList) { + Function rpc = validComplianceRpcMap.get(rpcName); + for (RepeatRequest repeatRequest : complianceGroup.getRequestsList()) { + ComplianceData expectedData = repeatRequest.getInfo(); + RepeatResponse response = rpc.apply(repeatRequest); + assertThat(response.getRequest().getInfo()).isEqualTo(expectedData); + } + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java new file mode 100644 index 0000000000..893eeb2679 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITIam.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.ImmutableList; +import com.google.iam.v1.Binding; +import com.google.iam.v1.GetIamPolicyRequest; +import com.google.iam.v1.Policy; +import com.google.iam.v1.SetIamPolicyRequest; +import com.google.iam.v1.TestIamPermissionsRequest; +import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ITIam { + private static final Policy DEFAULT_POLICY = + Policy.newBuilder() + .addBindings(Binding.newBuilder().setRole("foo.editor").addMembers("allUsers")) + .build(); + private static IdentityClient grpcClient; + private static IdentityClient httpjsonClient; + private String resourceName; + + @BeforeAll + static void createClients() throws Exception { + grpcClient = TestClientInitializer.createGrpcIdentityClient(); + httpjsonClient = TestClientInitializer.createHttpJsonIdentityClient(); + } + + @BeforeEach + void setupTests() { + resourceName = "users/" + UUID.randomUUID().toString().substring(0, 8); + } + + @AfterAll + public static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = grpcClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_setIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + Policy policy = httpjsonClient.setIamPolicy(policyRequest); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + + Policy policy = + grpcClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testHttpJson_getIamPolicy() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + + Policy policy = + httpjsonClient.getIamPolicy( + GetIamPolicyRequest.newBuilder().setResource(policyRequest.getResource()).build()); + assertThat(policy).isEqualTo(DEFAULT_POLICY); + } + + @Test + void testGrpc_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + grpcClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + grpcClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + @Test + void testHttpJson_testIamPermissions() { + SetIamPolicyRequest policyRequest = + SetIamPolicyRequest.newBuilder() + .setPolicy(DEFAULT_POLICY) + .setResource(resourceName) + .build(); + httpjsonClient.setIamPolicy(policyRequest); + List permissions = ImmutableList.of("foo.create", "foo.write"); + TestIamPermissionsResponse testIamPermissionsResponse = + httpjsonClient.testIamPermissions( + TestIamPermissionsRequest.newBuilder() + .setResource(policyRequest.getResource()) + .addAllPermissions(permissions) + .build()); + // Showcase server will simply echo the request's Permissions List back + // if the resource exists and contains a policy + assertThat(testIamPermissionsResponse.getPermissionsList()) + .containsExactlyElementsIn(permissions); + } + + // The tests below simply assert that an exception is being thrown for an invalid request + // in both transports. Showcase's IAM backend service will throw a few exceptions for a few + // cases, and we simply assert that an exception has been thrown for a single case with a single + // RPC (No resource in the request for SetIamPolicy's RPC). + @Test + void testGrpc_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> grpcClient.setIamPolicy(setIamPolicyRequest)); + } + + @Test + void testHttpJson_iamThrowsException() { + SetIamPolicyRequest setIamPolicyRequest = SetIamPolicyRequest.newBuilder().build(); + assertThrows( + InvalidArgumentException.class, () -> httpjsonClient.setIamPolicy(setIamPolicyRequest)); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java new file mode 100644 index 0000000000..09208861ba --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITLongRunningOperation.java @@ -0,0 +1,196 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.retrying.RetrySettings; +import com.google.protobuf.Timestamp; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.WaitMetadata; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.WaitResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.CancellationException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; +import org.threeten.bp.Instant; +import org.threeten.bp.temporal.ChronoUnit; + +/** + * For this test, we test a combination of various LRO RetrySettings and try to ensure that the + * calls are polling correctly. Each test attempts to test the number of attempts done in each call. + */ +class ITLongRunningOperation { + + @Test + void testGRPC_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("gRPCWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("gRPCWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROSuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(3000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(3000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(3000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + long epochSecondsInFuture = Instant.now().plus(5, ChronoUnit.SECONDS).getEpochSecond(); + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess( + WaitResponse.newBuilder().setContent("httpjsonWaitContent_5sDelay_noRetry")) + .setEndTime(Timestamp.newBuilder().setSeconds(epochSecondsInFuture).build()) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + WaitResponse waitResponse = operationFuture.get(); + assertThat(waitResponse.getContent()).isEqualTo("httpjsonWaitContent_5sDelay_noRetry"); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isAtLeast(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testGRPC_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + grpcClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_LROUnsuccessfulResponse_exceedsTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings initialUnaryRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(500L)) + .build(); + RetrySettings pollingRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(2.0) + .setMaxRetryDelay(Duration.ofMillis(500L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomWaitSettings( + initialUnaryRetrySettings, pollingRetrySettings); + try { + WaitRequest waitRequest = + WaitRequest.newBuilder() + .setSuccess(WaitResponse.newBuilder().setContent("httpjsonWaitContent_10sDelay")) + .setTtl(com.google.protobuf.Duration.newBuilder().setSeconds(10)) + .build(); + OperationFuture operationFuture = + httpjsonClient.waitOperationCallable().futureCall(waitRequest); + assertThrows(CancellationException.class, operationFuture::get); + int attemptCount = operationFuture.getPollingFuture().getAttemptSettings().getAttemptCount(); + assertThat(attemptCount).isGreaterThan(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java new file mode 100644 index 0000000000..76c54a803c --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITNumericEnums.java @@ -0,0 +1,67 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.jupiter.api.Assertions.assertEquals; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EnumRequest; +import com.google.showcase.v1beta1.EnumResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITNumericEnums { + + private static ComplianceClient httpjsonClient; + + @BeforeAll + static void createClients() 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(); + httpjsonClient = ComplianceClient.create(complianceSettings); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void verifyEnums() { + EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + EnumResponse initialResponse = httpjsonClient.getEnum(request); + assertEquals(initialResponse, httpjsonClient.verifyEnum(initialResponse)); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java new file mode 100644 index 0000000000..06f46deee8 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITOtelMetrics.java @@ -0,0 +1,922 @@ +/* + * Copyright 2024 Google LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google LLC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertThrows; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.api.gax.rpc.StatusCode.Code; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.api.gax.rpc.UnavailableException; +import com.google.api.gax.tracing.MetricsTracer; +import com.google.api.gax.tracing.MetricsTracerFactory; +import com.google.api.gax.tracing.OpenTelemetryMetricsRecorder; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.truth.Truth; +import com.google.protobuf.Duration; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ManagedChannelBuilder; +import io.grpc.opentelemetry.GrpcOpenTelemetry; +import io.opentelemetry.api.OpenTelemetry; +import io.opentelemetry.api.common.AttributeKey; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.sdk.OpenTelemetrySdk; +import io.opentelemetry.sdk.metrics.SdkMeterProvider; +import io.opentelemetry.sdk.metrics.data.Data; +import io.opentelemetry.sdk.metrics.data.HistogramPointData; +import io.opentelemetry.sdk.metrics.data.LongPointData; +import io.opentelemetry.sdk.metrics.data.MetricData; +import io.opentelemetry.sdk.metrics.data.PointData; +import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Showcase Test to confirm that metrics are being collected and that the correct metrics are being + * recorded. Utilizes an in-memory metric reader to collect the data. + * + *

Every test flows through the same way and runs through the same assertions. First, all th + * metrics are pulled in via {@link #getMetricDataList()} which are polled until all the metrics are + * collected. Then the test will attempt check that reader collected the correct number of data + * points in {@link #verifyPointDataSum(List, int)}. Then, check that the attributes to be collected + * via {@link #verifyStatusAttribute(List, List)}. Finally, check that the status for each attempt + * is correct. + */ +class ITOtelMetrics { + private static final int DEFAULT_OPERATION_COUNT = 1; + private static final String SERVICE_NAME = "ShowcaseTest"; + private static final String ATTEMPT_COUNT = SERVICE_NAME + "/attempt_count"; + private static final String OPERATION_COUNT = SERVICE_NAME + "/operation_count"; + private static final String ATTEMPT_LATENCY = SERVICE_NAME + "/attempt_latency"; + private static final String OPERATION_LATENCY = SERVICE_NAME + "/operation_latency"; + private static final Set GAX_METRICS = + ImmutableSet.of(ATTEMPT_COUNT, OPERATION_COUNT, ATTEMPT_LATENCY, OPERATION_LATENCY); + + // Gax provides four metrics by default. This number may change as new metrics are added. + private static final int NUM_GAX_OTEL_METRICS = 4; + private static final int NUM_DEFAULT_FLUSH_ATTEMPTS = 10; + + private InMemoryMetricReader inMemoryMetricReader; + private EchoClient grpcClient; + private EchoClient httpClient; + + /** + * Internal class in the Otel Showcases test used to assert that number of status codes recorded. + */ + private static class StatusCount { + private final Code statusCode; + private final int count; + + public StatusCount(Code statusCode) { + this(statusCode, 1); + } + + public StatusCount(Code statusCode, int count) { + this.statusCode = statusCode; + this.count = count; + } + + public Code getStatusCode() { + return statusCode; + } + + public int getCount() { + return count; + } + } + + private OpenTelemetryMetricsRecorder createOtelMetricsRecorder( + InMemoryMetricReader inMemoryMetricReader) { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + return new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + } + + @BeforeEach + void setup() throws Exception { + inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + grpcClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + httpClient = + TestClientInitializer.createHttpJsonEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder)); + } + + @AfterEach + void cleanup() throws InterruptedException, IOException { + inMemoryMetricReader.close(); + inMemoryMetricReader.shutdown(); + + grpcClient.close(); + httpClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + /** + * Iterate through all MetricData elements and check that the number of PointData values matches + * the expected value. A PointData element may have multiple values/ counts inside, so this + * extracts the value/ count from the PointData before summing. + * + *

The expected sum for an operation is `1`. Expected sum for an attempt may be 1+. + */ + private void verifyPointDataSum(List metricDataList, int attemptCount) { + for (MetricData metricData : metricDataList) { + Data data = metricData.getData(); + List points = new ArrayList<>(data.getPoints()); + switch (metricData.getName()) { + case OPERATION_COUNT: + long operationCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(operationCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_COUNT: + long attemptCountSum = + points.stream().map(x -> ((LongPointData) x).getValue()).reduce(0L, Long::sum); + Truth.assertThat(attemptCountSum).isEqualTo(attemptCount); + break; + case OPERATION_LATENCY: + long operationLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(operationLatencyCountSum).isEqualTo(DEFAULT_OPERATION_COUNT); + break; + case ATTEMPT_LATENCY: + long attemptLatencyCountSum = + points.stream().map(x -> ((HistogramPointData) x).getCount()).reduce(0L, Long::sum); + // It is difficult to verify the actual latency values (operation or attempt) + // without flaky behavior. Test that the number of data points recorded matches. + Truth.assertThat(attemptLatencyCountSum).isEqualTo(attemptCount); + break; + default: + break; + } + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `OPERATION_COUNT` MetricData to test the attributes. The `OPERATION_COUNT` is only recorded + * once and should only have one element of PointData. + * + *

Although the Status attribute is recorded by default on every operation, this helper method + * does not verify it. This is because every individual attempt (retry) may have a different + * status. {@link #verifyStatusAttribute(List, List)} is used to verify the statuses for every + * attempt. + */ + private void verifyDefaultMetricsAttributes( + List metricDataList, Map defaultAttributeMapping) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(OPERATION_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData operationCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(operationCountMetricData.getData().getPoints()); + // Operation Metrics should only have a 1 data point + Truth.assertThat(pointDataList.size()).isEqualTo(1); + Attributes recordedAttributes = pointDataList.get(0).getAttributes(); + Map, Object> recordedAttributesMap = recordedAttributes.asMap(); + for (Map.Entry entrySet : defaultAttributeMapping.entrySet()) { + String key = entrySet.getKey(); + String value = entrySet.getValue(); + AttributeKey stringAttributeKey = AttributeKey.stringKey(key); + Truth.assertThat(recordedAttributesMap.containsKey(stringAttributeKey)).isTrue(); + Truth.assertThat(recordedAttributesMap.get(stringAttributeKey)).isEqualTo(value); + } + } + + /** + * Extract the attributes from MetricData and ensures that default attributes are recorded. Uses + * the `ATTEMPT_COUNT` MetricData to test the attributes. The `ATTEMPT_COUNT` is recorded for + * every retry attempt and should record the status received that each attempt made. + */ + private void verifyStatusAttribute( + List metricDataList, List statusCountList) { + Optional metricDataOptional = + metricDataList.stream().filter(x -> x.getName().equals(ATTEMPT_COUNT)).findAny(); + Truth.assertThat(metricDataOptional.isPresent()).isTrue(); + MetricData attemptCountMetricData = metricDataOptional.get(); + + List pointDataList = new ArrayList<>(attemptCountMetricData.getData().getPoints()); + Truth.assertThat(pointDataList.size()).isEqualTo(statusCountList.size()); + + // The data for attempt count may not be ordered (i.e. the last data point recorded may be the + // first element in the PointData list). Search for the expected StatusCode from the + // statusCountList + // and match with the data inside the pointDataList + for (StatusCount statusCount : statusCountList) { + Code statusCode = statusCount.getStatusCode(); + Predicate pointDataPredicate = + x -> + x.getAttributes() + .get(AttributeKey.stringKey(MetricsTracer.STATUS_ATTRIBUTE)) + .equals(statusCode.toString()); + Optional pointDataOptional = + pointDataList.stream().filter(pointDataPredicate).findFirst(); + Truth.assertThat(pointDataOptional.isPresent()).isTrue(); + LongPointData longPointData = (LongPointData) pointDataOptional.get(); + Truth.assertThat(longPointData.getValue()).isEqualTo(statusCount.getCount()); + } + } + + /** Uses the default InMemoryMetricReader configured for showcase tests. */ + private List getMetricDataList() throws InterruptedException { + return getMetricDataList(inMemoryMetricReader); + } + + /** + * Attempts to retrieve the metrics from a custom InMemoryMetricsReader. Sleep every second for at + * most 10s to try and retrieve all the metrics available. If it is unable to retrieve all the + * metrics, fail the test. + */ + private List getMetricDataList(InMemoryMetricReader metricReader) + throws InterruptedException { + for (int i = 0; i < NUM_DEFAULT_FLUSH_ATTEMPTS; i++) { + Thread.sleep(1000L); + List metricData = new ArrayList<>(metricReader.collectAllMetrics()); + // Depending on the OpenTelemetry instance (i.e. OpenTelemetry, GrpcOpenTelemetry, etc.) + // there may be additional metrics recorded. Only check to ensure the Gax Metrics + // are recorded properly. Any additional metrics are fine to be passed. + if (metricData.size() >= NUM_GAX_OTEL_METRICS && areAllGaxMetricsRecorded(metricData)) { + return metricData; + } + } + Assertions.fail("Unable to collect all the GAX metrics required for the test"); + return new ArrayList<>(); + } + + private boolean areAllGaxMetricsRecorded(List metricData) { + return metricData.stream().filter(data -> GAX_METRICS.contains(data.getName())).count() + == NUM_GAX_OTEL_METRICS; + } + + @Test + void testGrpc_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_operation_succeeded").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationSucceeded_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + httpClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "google.showcase.v1beta1.Echo/Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(5)) + .setSuccess(BlockResponse.newBuilder().setContent("grpc_operationCancelled")) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationCancelled_recordsMetrics() throws Exception { + int attemptCount = 1; + BlockRequest blockRequest = + BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().setSeconds(5)).build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + // Sleep 1s before cancelling to let the request go through + Thread.sleep(1000); + blockResponseApiFuture.cancel(true); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "google.showcase.v1beta1.Echo/Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(Code.CANCELLED)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = grpcClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_operationFailed_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2)) + .setError(Status.newBuilder().setCode(statusCode.ordinal())) + .build(); + + UnaryCallable blockCallable = httpClient.blockCallable(); + ApiFuture blockResponseApiFuture = blockCallable.futureCall(blockRequest); + assertThrows(ExecutionException.class, blockResponseApiFuture::get); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "google.showcase.v1beta1.Echo/Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> grpcClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_attemptFailedRetriesExhausted_recordsMetrics() throws Exception { + int attemptCount = 3; + Code statusCode = Code.UNAVAILABLE; + // A custom EchoClient is used in this test because retries have jitter, and we cannot + // predict the number of attempts that are scheduled for an RPC invocation otherwise. + // The custom retrySettings limit to a set number of attempts before the call gives up. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(5000L)) + .setMaxAttempts(3) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(statusCode)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient httpClient = EchoClient.create(stub); + + EchoRequest echoRequest = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(UnavailableException.class, () -> httpClient.echo(echoRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "google.showcase.v1beta1.Echo/Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode, 3)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> grpcClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testHttpJson_attemptPermanentFailure_recordsMetrics() throws InterruptedException { + int attemptCount = 1; + Code statusCode = Code.INVALID_ARGUMENT; + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(2).build()) + .setError(Status.newBuilder().setCode(statusCode.ordinal()).build()) + .build(); + + assertThrows(InvalidArgumentException.class, () -> httpClient.block(blockRequest)); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "google.showcase.v1beta1.Echo/Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = ImmutableList.of(new StatusCount(statusCode)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + } + + @Test + void testGrpc_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + // Disable Jitter on this test to try and ensure that the there are 3 attempts made + // for test. The first two calls should result in a DEADLINE_EXCEEDED exception as + // 0.5s and 1s are too short for the 1s blocking call (1s still requires time for + // the showcase server to respond back to the client). The 3rd and final call (2s) + // should result in an OK Status Code. + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469") + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient grpcClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("grpcBlockResponse")) + .build(); + + grpcClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + List statusCountList = + ImmutableList.of(new StatusCount(Code.DEADLINE_EXCEEDED, 2), new StatusCount(Code.OK)); + verifyStatusAttribute(actualMetricDataList, statusCountList); + + grpcClient.close(); + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_multipleFailedAttempts_successfulOperation() throws Exception { + int attemptCount = 3; + RetrySettings retrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(org.threeten.bp.Duration.ofMillis(500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(org.threeten.bp.Duration.ofMillis(2000L)) + .setTotalTimeout(org.threeten.bp.Duration.ofMillis(6000L)) + .setJittered(false) + .build(); + + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(ImmutableSet.of(Code.DEADLINE_EXCEEDED)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint("http://localhost:7469") + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory( + new MetricsTracerFactory(createOtelMetricsRecorder(inMemoryMetricReader))) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + EchoClient httpClient = EchoClient.create(stub); + + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setResponseDelay(Duration.newBuilder().setSeconds(1)) + .setSuccess(BlockResponse.newBuilder().setContent("httpjsonBlockResponse")) + .build(); + + httpClient.block(blockRequest); + + List actualMetricDataList = getMetricDataList(); + verifyPointDataSum(actualMetricDataList, attemptCount); + + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "google.showcase.v1beta1.Echo/Block", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + + httpClient.close(); + httpClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void recordsCustomAttributes() throws InterruptedException, IOException { + InstantiatingGrpcChannelProvider channelProvider = + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setAttemptDirectPathXds() + .build(); + + // Add custom attributes to be added as client level attributes + Map customAttributes = new HashMap<>(); + String directpathEnabled = "directpath_enabled"; + customAttributes.put(directpathEnabled, String.valueOf(channelProvider.canUseDirectPath())); + String directpathXdsEnabled = "directpathxds_enabled"; + customAttributes.put( + directpathXdsEnabled, String.valueOf(channelProvider.isDirectPathXdsEnabled())); + String randomAttributeKey1 = "testing"; + String randomAttributeValue1 = "showcase"; + String randomAttributeKey2 = "hello"; + String randomAttributeValue2 = "world"; + customAttributes.put(randomAttributeKey1, randomAttributeValue1); + customAttributes.put(randomAttributeKey2, randomAttributeValue2); + + InMemoryMetricReader inMemoryMetricReader = InMemoryMetricReader.create(); + OpenTelemetryMetricsRecorder otelMetricsRecorder = + createOtelMetricsRecorder(inMemoryMetricReader); + MetricsTracerFactory metricsTracerFactory = + new MetricsTracerFactory(otelMetricsRecorder, customAttributes); + + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(channelProvider) + .setEndpoint(TestClientInitializer.DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + EchoClient grpcClient = EchoClient.create(stub); + + EchoRequest echoRequest = EchoRequest.newBuilder().setContent("content").build(); + grpcClient.echo(echoRequest); + + List actualMetricDataList = getMetricDataList(inMemoryMetricReader); + Map expectedAttributes = + ImmutableMap.of( + MetricsTracer.METHOD_ATTRIBUTE, + "Echo.Echo", + MetricsTracer.LANGUAGE_ATTRIBUTE, + MetricsTracer.DEFAULT_LANGUAGE, + directpathEnabled, + "false", + directpathXdsEnabled, + "true", + randomAttributeKey1, + randomAttributeValue1, + randomAttributeKey2, + randomAttributeValue2); + verifyDefaultMetricsAttributes(actualMetricDataList, expectedAttributes); + } + + // This test case uses GrpcOpenTelemetry from grpc-java and includes additional grpc-java specific + // metrics. This test case ensures that the `setSampledToLocalTracing` set to true will ensure + // that + // the gRPC full method name in the stub is recorded (not recorded as `other`). + @Test + void grpcOpenTelemetryImplementation_setSampledToLocalTracing_methodFullNameIsRecorded() + throws Exception { + SdkMeterProvider sdkMeterProvider = + SdkMeterProvider.builder().registerMetricReader(inMemoryMetricReader).build(); + + OpenTelemetry openTelemetry = + OpenTelemetrySdk.builder().setMeterProvider(sdkMeterProvider).build(); + + GrpcOpenTelemetry grpcOpenTelemetry = GrpcOpenTelemetry.newBuilder().sdk(openTelemetry).build(); + + // Java-Spanner configures the InstantiatingGrpcChannelProvider with gRPCOpenTelemetry + // This setup below is copied from their implementation + InstantiatingGrpcChannelProvider.Builder builder = + EchoSettings.defaultGrpcTransportProviderBuilder(); + ApiFunction channelConfigurator = + builder.getChannelConfigurator(); + builder.setChannelConfigurator( + b -> { + b.usePlaintext(); + grpcOpenTelemetry.configureChannelBuilder(b); + if (channelConfigurator != null) { + return channelConfigurator.apply(b); + } + return b; + }); + + OpenTelemetryMetricsRecorder otelMetricsRecorder = + new OpenTelemetryMetricsRecorder(openTelemetry, SERVICE_NAME); + + // Create a custom EchoClient that is different from what is created by default in setup() + EchoClient echoClient = + TestClientInitializer.createGrpcEchoClientOpentelemetry( + new MetricsTracerFactory(otelMetricsRecorder), builder.build()); + + EchoRequest echoRequest = + EchoRequest.newBuilder().setContent("test_grpc_request_succeeded").build(); + echoClient.echo(echoRequest); + + List metricDataList = getMetricDataList(); + + String gRPCMetricNamePrefix = "grpc."; + String gRPCMethodNameAttributeKey = "grpc.method"; + + List grpcMetricDataList = + metricDataList.stream() + .filter(x -> x.getName().startsWith(gRPCMetricNamePrefix)) + .collect(Collectors.toList()); + Truth.assertThat(grpcMetricDataList).isNotEmpty(); + for (MetricData grpcMetricData : grpcMetricDataList) { + List pointDataList = new ArrayList<>(grpcMetricData.getData().getPoints()); + + for (PointData pointData : pointDataList) { + String methodName = + pointData.getAttributes().get(AttributeKey.stringKey(gRPCMethodNameAttributeKey)); + + // All the attributes in the gRPC metrics should have the full method name + Truth.assertThat(methodName).doesNotMatch("other"); + Truth.assertThat(methodName).matches("^google.showcase.v1beta1.Echo/.*$"); + } + } + + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java new file mode 100644 index 0000000000..ebcabeab9e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITPagination.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; + +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.PagedExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITPagination { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenGrpc() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + grpcClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + // This tests that pagination returns the correct number of pages + responses and that + // the content is correct. + // + // The pageToken is where the streaming responses come back from and the page size denotes + // how many of the responses come back together (in a page). i.e for PageSize = 2 and + // PageToken = 3, see below: + // | A | Series | Of | Words | That | Will | Be | Sent | Back | One | By | One + // Page # | - | - | - | 1 | 1 | 2 | 2 | 3 | 3 | 4 | 4 | 5 + // Token # | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 + @Test + void testPagedExpandWithTokenHttpJson() { + int pageSize = 2; + int pageToken = 3; + String content = "A series of words that will be sent back one by one"; + int contentLength = content.split(" ").length; + + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse = + httpjsonClient.pagedExpand( + PagedExpandRequest.newBuilder() + .setContent(content) + .setPageSize(pageSize) + .setPageToken(String.valueOf(pageToken)) + .build()); + + String[] expected = content.split(" "); + int numExpectedPages = ((contentLength - pageToken) / pageSize); + // If the responses can't be evenly split into pages, then the extra responses + // will go to an additional page + if ((contentLength - pageToken) % pageSize != 0) { + numExpectedPages++; + } + int numExpectedResponses = contentLength - pageToken; + + validatePagedResponses( + pagedExpandPagedResponse, expected, pageToken, numExpectedResponses, numExpectedPages); + } + + private void validatePagedResponses( + EchoClient.PagedExpandPagedResponse pagedExpandPagedResponse, + String[] expected, + int pageToken, + int numExpectedResponses, + int numExpectedPages) { + int numResponses = 0; + int numPages = 0; + for (EchoClient.PagedExpandPage page : pagedExpandPagedResponse.iteratePages()) { + for (EchoResponse echoResponse : page.getValues()) { + // Add pageToken as offset to the expected array to start indexing at the pageToken + assertThat(echoResponse.getContent()).isEqualTo(expected[numResponses + pageToken]); + numResponses++; + } + numPages++; + } + + assertThat(numPages).isEqualTo(numExpectedPages); + assertThat(numResponses).isEqualTo(numExpectedResponses); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java new file mode 100644 index 0000000000..9d9ccba39e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITServerSideStreaming.java @@ -0,0 +1,201 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.ServerStream; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.WatchdogTimeoutException; +import com.google.common.collect.ImmutableList; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.ExpandRequest; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import io.grpc.ManagedChannelBuilder; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class ITServerSideStreaming { + + private static EchoClient grpcClient; + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_receiveStreamedContentStreamAPI() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + grpcClient.expandCallable().call(ExpandRequest.newBuilder().setContent(content).build()); + assertThat(responseStream.stream().map(EchoResponse::getContent).collect(Collectors.toList())) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Test + void testGrpc_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + grpcClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + @Test + void testGrpc_serverWaitTimeout_watchdogCancelsStream() throws Exception { + EchoSettings.Builder settings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint("localhost:7469"); + + settings + .expandSettings() + .setIdleTimeout(Duration.ofMillis(100)) + .setWaitTimeout(Duration.ofMillis(100)); + + settings.getStubSettingsBuilder().setStreamWatchdogCheckInterval(Duration.ofMillis(50)); + + EchoClient echoClient = EchoClient.create(settings.build()); + + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + echoClient + .expandCallable() + .call( + ExpandRequest.newBuilder() + .setContent(content) + // Configure server interval for returning the next response + .setStreamWaitTime( + com.google.protobuf.Duration.newBuilder().setSeconds(1).build()) + .build()); + List responses = new ArrayList<>(); + WatchdogTimeoutException exception = + assertThrows( + WatchdogTimeoutException.class, + () -> responseStream.forEach(x -> responses.add(x.getContent()))); + assertThat(exception) + .hasMessageThat() + .contains("Canceled due to timeout waiting for next response"); + echoClient.close(); + echoClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testHttpJson_receiveStreamedContent() { + String content = "The rain in Spain stays mainly on the plain!"; + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).build()); + ArrayList responses = new ArrayList<>(); + for (EchoResponse response : responseStream) { + responses.add(response.getContent()); + } + + assertThat(responses) + .containsExactlyElementsIn( + ImmutableList.of( + "The", "rain", "in", "Spain", "stays", "mainly", "on", "the", "plain!")) + .inOrder(); + } + + @Disabled( + value = "Ignore until https://github.com/googleapis/gapic-showcase/issues/1286 is resolved") + @Test + void testHttpJson_serverError_receiveErrorAfterLastWordInStream() { + String content = "The rain in Spain"; + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + ServerStream responseStream = + httpjsonClient + .expandCallable() + .call(ExpandRequest.newBuilder().setContent(content).setError(cancelledStatus).build()); + Iterator echoResponseIterator = responseStream.iterator(); + + assertThat(echoResponseIterator.next().getContent()).isEqualTo("The"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("rain"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("in"); + assertThat(echoResponseIterator.next().getContent()).isEqualTo("Spain"); + CancelledException cancelledException = + assertThrows(CancelledException.class, echoResponseIterator::next); + assertThat(cancelledException.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java new file mode 100644 index 0000000000..f7f801f627 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITTimeObjectsPropagationTest.java @@ -0,0 +1,64 @@ +package com.google.showcase.v1beta1.it; + +import static org.junit.Assert.assertEquals; + +import com.google.api.gax.retrying.RetrySettings; +import org.junit.Test; + +/** + * Tests to confirm that usage of retry settings can be done regardless of whether threeten or + * java.time is being used + */ +public class ITTimeObjectsPropagationTest { + @Test + public void testRetrySettings_fromJavaTimeHasEquivalentThreetenValues() { + java.time.Duration javaTimeCommonValue = java.time.Duration.ofMillis(123l); + org.threeten.bp.Duration threetenConvertedValue = + org.threeten.bp.Duration.ofMillis(javaTimeCommonValue.toMillis()); + RetrySettings javaTimeRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(javaTimeCommonValue) + .setMaxRetryDelayDuration(javaTimeCommonValue) + .setInitialRpcTimeoutDuration(javaTimeCommonValue) + .setMaxRpcTimeoutDuration(javaTimeCommonValue) + .setTotalTimeoutDuration(javaTimeCommonValue) + .build(); + + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + threetenConvertedValue.toMillis(), javaTimeRetrySettings.getTotalTimeout().toMillis()); + } + + @Test + public void testRetrySettings_fromThreetenHasEquivalentJavaTimeValues() { + org.threeten.bp.Duration threetenCommonValue = org.threeten.bp.Duration.ofMillis(123l); + java.time.Duration javaTimeConvertedValue = + java.time.Duration.ofMillis(threetenCommonValue.toMillis()); + RetrySettings threetenRetrySettings = + RetrySettings.newBuilder() + .setInitialRetryDelay(threetenCommonValue) + .setMaxRetryDelay(threetenCommonValue) + .setInitialRpcTimeout(threetenCommonValue) + .setMaxRpcTimeout(threetenCommonValue) + .setTotalTimeout(threetenCommonValue) + .build(); + + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRetryDelay().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getInitialRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getMaxRpcTimeout().toMillis()); + assertEquals( + javaTimeConvertedValue.toMillis(), threetenRetrySettings.getTotalTimeout().toMillis()); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java new file mode 100644 index 0000000000..4d6018f6fc --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryCallable.java @@ -0,0 +1,101 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.grpc.GrpcStatusCode; +import com.google.api.gax.rpc.CancelledException; +import com.google.api.gax.rpc.StatusCode; +import com.google.rpc.Status; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class ITUnaryCallable { + + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent() { + assertThat(echoGrpc("grpc-echo?")).isEqualTo("grpc-echo?"); + assertThat(echoGrpc("grpc-echo!")).isEqualTo("grpc-echo!"); + } + + @Test + void testGrpc_serverResponseError_throwsException() { + Status cancelledStatus = + Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build(); + EchoRequest requestWithServerError = EchoRequest.newBuilder().setError(cancelledStatus).build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> grpcClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(GrpcStatusCode.Code.CANCELLED); + } + + @Test + void testHttpJson_receiveContent() { + assertThat(echoHttpJson("http-echo?")).isEqualTo("http-echo?"); + assertThat(echoHttpJson("http-echo!")).isEqualTo("http-echo!"); + } + + @Test + void testHttpJson_serverResponseError_throwsException() { + EchoRequest requestWithServerError = + EchoRequest.newBuilder() + .setError(Status.newBuilder().setCode(StatusCode.Code.CANCELLED.ordinal()).build()) + .build(); + CancelledException exception = + assertThrows(CancelledException.class, () -> httpjsonClient.echo(requestWithServerError)); + assertThat(exception.getStatusCode().getCode()).isEqualTo(StatusCode.Code.CANCELLED); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java new file mode 100644 index 0000000000..984598bc9e --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITUnaryDeadline.java @@ -0,0 +1,368 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.rpc.DeadlineExceededException; +import com.google.api.gax.rpc.StatusCode; +import com.google.common.collect.ImmutableSet; +import com.google.showcase.v1beta1.BlockRequest; +import com.google.showcase.v1beta1.BlockResponse; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +/** + * For this test, we test a combination of various RetrySettings to try and ensure that the timeouts + * set by the customer are cancelled when timeouts have exceeded their limits + * + *

Each test attempts to get the number of attempts done in each call. The attemptCount is + * incremented by 1 as the first attempt is zero indexed. + */ +class ITUnaryDeadline { + + @Test + void testGRPC_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + @Test + void testHttpJson_unarySuccessfulResponse_doesNotExceedTotalTimeout() throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_3sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(3).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_3sDelay_noRetry"); + // Guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testGRPC_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("gRPCBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Retry is configured by setting the initial RPC timeout (1.5s) to be less than + // the RPC delay (2s). The next RPC timeout (3s) will wait long enough for the delay. + @Test + void testHttpJson_unarySuccessfulResponse_exceedsRPCDeadlineButWithinTotalTimeout() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(1500L)) + .setRpcTimeoutMultiplier(2.0) + .setMaxRpcTimeout(Duration.ofMillis(3000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_2sDelay_Retry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(2).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + BlockResponse blockResponse = retryingFuture.get(10, TimeUnit.SECONDS); + assertThat(blockResponse.getContent()).isEqualTo("httpjsonBlockContent_2sDelay_Retry"); + // Guarantee that this only runs twice + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(2); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testGRPC_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess(BlockResponse.newBuilder().setContent("gRPCBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // Request is set to block for 6 seconds to allow the RPC to timeout. If retries are + // disabled, the RPC timeout is set to be the totalTimeout (5s). + @Test + void + testHttpJson_unaryUnsuccessfulResponse_exceedsRPCTimeoutAndTotalTimeout_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultNoRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(5000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(5000L)) + .setTotalTimeout(Duration.ofMillis(5000L)) + // Explicitly set retries as disabled (maxAttempts == 1) + .setMaxAttempts(1) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultNoRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_6sDelay_noRetry")) + .setResponseDelay(com.google.protobuf.Duration.newBuilder().setSeconds(6).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We can guarantee that this only runs once + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isEqualTo(1); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void testGRPC_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(1000L)) + .build(); + EchoClient grpcClient = + TestClientInitializer.createGrpcEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("gRPCBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) grpcClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(10, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(5); + assertThat(attemptCount).isAtMost(10); + } finally { + grpcClient.close(); + grpcClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } + + // The purpose of this test is to ensure that the deadlineScheduleExecutor is able + // to properly cancel the HttpRequest for each retry attempt. This test attempts to + // make a call every 100ms for 1 second. If the requestRunnable blocks until we + // receive a response from the server (200ms) regardless of it was cancelled, then + // we would expect at most 50 responses. + @Test + void + testHttpJson_unaryCallableRetry_deadlineExecutorTimesOutRequest_throwsDeadlineExceededException() + throws Exception { + RetrySettings defaultRetrySettings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(100L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(100L)) + .setTotalTimeout(Duration.ofMillis(10000L)) + .build(); + EchoClient httpjsonClient = + TestClientInitializer.createHttpJsonEchoClientCustomBlockSettings( + defaultRetrySettings, ImmutableSet.of(StatusCode.Code.DEADLINE_EXCEEDED)); + try { + BlockRequest blockRequest = + BlockRequest.newBuilder() + .setSuccess( + BlockResponse.newBuilder().setContent("httpjsonBlockContent_200msDelay_Retry")) + // Set the timeout to be longer than the RPC timeout + .setResponseDelay( + com.google.protobuf.Duration.newBuilder().setNanos(200000000).build()) + .build(); + RetryingFuture retryingFuture = + (RetryingFuture) httpjsonClient.blockCallable().futureCall(blockRequest); + ExecutionException exception = + assertThrows(ExecutionException.class, () -> retryingFuture.get(15, TimeUnit.SECONDS)); + assertThat(exception.getCause()).isInstanceOf(DeadlineExceededException.class); + DeadlineExceededException deadlineExceededException = + (DeadlineExceededException) exception.getCause(); + assertThat(deadlineExceededException.getStatusCode().getCode()) + .isEqualTo(StatusCode.Code.DEADLINE_EXCEEDED); + // We cannot guarantee the number of attempts. The RetrySettings should be configured + // such that there is no delay between the attempts, but the execution takes time + // to run. Theoretically this should run exactly 100 times. + int attemptCount = retryingFuture.getAttemptSettings().getAttemptCount() + 1; + assertThat(attemptCount).isGreaterThan(80); + assertThat(attemptCount).isAtMost(100); + } finally { + httpjsonClient.close(); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java new file mode 100644 index 0000000000..1cf9f0f577 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/ITVersionHeaders.java @@ -0,0 +1,249 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 com.google.common.truth.Truth.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.google.api.gax.httpjson.*; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.FixedHeaderProvider; +import com.google.api.gax.rpc.StubSettings; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.*; +import com.google.showcase.v1beta1.it.util.GrpcCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.HttpJsonCapturingClientInterceptor; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import com.google.showcase.v1beta1.stub.ComplianceStubSettings; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.*; +import java.io.IOException; +import java.util.ArrayList; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +// TODO: add testing on error responses once feat is implemented in showcase. +// https://github.com/googleapis/gapic-showcase/pull/1456 +// TODO: watch for showcase gRPC trailer changes suggested in +// https://github.com/googleapis/gapic-showcase/pull/1509#issuecomment-2089147103 +class ITVersionHeaders { + private static final String HTTP_RESPONSE_HEADER_STRING = + "x-showcase-request-" + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + private static final String HTTP_CLIENT_API_HEADER_KEY = + "x-showcase-request-" + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(); + private static final Metadata.Key API_VERSION_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, Metadata.ASCII_STRING_MARSHALLER); + + private static final Metadata.Key API_CLIENT_HEADER_KEY = + Metadata.Key.of( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), Metadata.ASCII_STRING_MARSHALLER); + + private static final String EXPECTED_ECHO_API_VERSION = "v1_20240408"; + private static final String CUSTOM_API_VERSION = "user-supplied-version"; + private static final String EXPECTED_EXCEPTION_MESSAGE = + "Header provider can't override the header: " + + ApiClientHeaderProvider.API_VERSION_HEADER_KEY; + + private static HttpJsonCapturingClientInterceptor httpJsonInterceptor; + private static GrpcCapturingClientInterceptor grpcInterceptor; + private static HttpJsonCapturingClientInterceptor httpJsonComplianceInterceptor; + private static GrpcCapturingClientInterceptor grpcComplianceInterceptor; + private static EchoClient grpcClient; + private static EchoClient httpJsonClient; + private static ComplianceClient grpcComplianceClient; + private static ComplianceClient httpJsonComplianceClient; + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Interceptor and Client + grpcInterceptor = new GrpcCapturingClientInterceptor(); + grpcClient = TestClientInitializer.createGrpcEchoClient(ImmutableList.of(grpcInterceptor)); + + // Create HttpJson Interceptor and Client + httpJsonInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonClient = + TestClientInitializer.createHttpJsonEchoClient(ImmutableList.of(httpJsonInterceptor)); + + // Create gRPC ComplianceClient and Interceptor + // Creating a compliance client to test case where api version is not set + grpcComplianceInterceptor = new GrpcCapturingClientInterceptor(); + grpcComplianceClient = + TestClientInitializer.createGrpcComplianceClient( + ImmutableList.of(grpcComplianceInterceptor)); + + // Create HttpJson ComplianceClient and Interceptor + httpJsonComplianceInterceptor = new HttpJsonCapturingClientInterceptor(); + httpJsonComplianceClient = + TestClientInitializer.createHttpJsonComplianceClient( + ImmutableList.of(httpJsonComplianceInterceptor)); + } + + @AfterAll + static void destroyClient() throws InterruptedException { + grpcClient.close(); + httpJsonClient.close(); + grpcComplianceClient.close(); + httpJsonComplianceClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + grpcComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpJsonComplianceClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_matchesApiVersion() { + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testHttpJson_matchesHeaderName() { + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) httpJsonInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(EXPECTED_ECHO_API_VERSION); + } + + @Test + void testGrpc_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + grpcComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY).isNotIn(grpcComplianceInterceptor.metadata.keys()); + } + + @Test + void testHttpJson_noApiVersion() { + RepeatRequest request = + RepeatRequest.newBuilder().setInfo(ComplianceData.newBuilder().setFString("test")).build(); + httpJsonComplianceClient.repeatDataSimplePath(request); + assertThat(API_VERSION_HEADER_KEY) + .isNotIn(httpJsonComplianceInterceptor.metadata.getHeaders().keySet()); + } + + @Test + void testGrpcEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + grpcClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testHttpJsonEcho_userApiVersionThrowsException() throws IOException { + StubSettings stubSettings = + httpJsonClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + + IllegalArgumentException exception = + assertThrows( + IllegalArgumentException.class, + () -> EchoClient.create(EchoSettings.create((EchoStubSettings) stubSettings))); + assertThat(exception.getMessage()).isEqualTo(EXPECTED_EXCEPTION_MESSAGE); + } + + @Test + void testGrpcCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings stubSettingsWithApiVersionHeader = + grpcComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create((ComplianceStubSettings) stubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + String headerValue = grpcComplianceInterceptor.metadata.get(API_VERSION_HEADER_KEY); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testHttpJsonCompliance_userApiVersionSetSuccess() throws IOException { + StubSettings httpJsonStubSettingsWithApiVersionHeader = + httpJsonComplianceClient.getSettings().getStubSettings().toBuilder() + .setHeaderProvider( + FixedHeaderProvider.create( + ApiClientHeaderProvider.API_VERSION_HEADER_KEY, CUSTOM_API_VERSION)) + .build(); + try (ComplianceClient customComplianceClient = + ComplianceClient.create( + ComplianceSettings.create( + (ComplianceStubSettings) httpJsonStubSettingsWithApiVersionHeader))) { + + RepeatRequest request = + RepeatRequest.newBuilder() + .setInfo(ComplianceData.newBuilder().setFString("test")) + .build(); + customComplianceClient.repeatDataSimplePath(request); + + ArrayList headerValues = + (ArrayList) + httpJsonComplianceInterceptor.metadata.getHeaders().get(HTTP_RESPONSE_HEADER_STRING); + String headerValue = (String) headerValues.get(0); + assertThat(headerValue).isEqualTo(CUSTOM_API_VERSION); + } + } + + @Test + void testGrpcCall_sendsCorrectApiClientHeader() { + Pattern defautlGrpcHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* grpc/.* protobuf/\\d.*"); + grpcClient.echo(EchoRequest.newBuilder().build()); + String headerValue = grpcInterceptor.metadata.get(API_CLIENT_HEADER_KEY); + assertTrue(defautlGrpcHeaderPattern.matcher(headerValue).matches()); + } + + @Test + void testHttpJson_sendsCorrectApiClientHeader() { + Pattern defautlHttpHeaderPattern = + Pattern.compile("gl-java/.* gapic/.*?--protobuf-\\d.* gax/.* rest/ protobuf/\\d.*"); + httpJsonClient.echo(EchoRequest.newBuilder().build()); + ArrayList headerValues = + (ArrayList) + httpJsonInterceptor.metadata.getHeaders().get(HTTP_CLIENT_API_HEADER_KEY); + String headerValue = headerValues.get(0); + assertTrue(defautlHttpHeaderPattern.matcher(headerValue).matches()); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java new file mode 100644 index 0000000000..5979b88c41 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging.java @@ -0,0 +1,257 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; +import org.slf4j.event.KeyValuePair; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn clean verify -P '!showcase,enable-integration-tests,loggingTestBase,slf4j2_logback' +public class ITLogging { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final KeyValuePair SERVICE_NAME_KEY_VALUE_PAIR = + new KeyValuePair("serviceName", "google.showcase.v1beta1.Echo"); + private static final KeyValuePair RPC_NAME_KEY_VALUE_PAIR = + new KeyValuePair("rpcName", "google.showcase.v1beta1.Echo/Echo"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR = + new KeyValuePair("response.status", "OK"); + private static final KeyValuePair RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP = + new KeyValuePair("response.status", "200"); + private static final KeyValuePair REQUEST_URL_KEY_VALUE_PAIR = + new KeyValuePair("request.url", "http://localhost:7469"); + + private static final KeyValuePair RESPONSE_HEADERS_KEY_VALUE_PAIR = + new KeyValuePair("response.headers", ImmutableMap.of("content-type", "application/grpc")); + + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(5); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, + RESPONSE_HEADERS_KEY_VALUE_PAIR, + SERVICE_NAME_KEY_VALUE_PAIR, + RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + } + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).containsAtLeast(SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(3); + assertThat(keyValuePairs2) + .containsAtLeast( + RESPONSE_STATUS_KEY_VALUE_PAIR, SERVICE_NAME_KEY_VALUE_PAIR, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(4); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + for (KeyValuePair kvp : keyValuePairs) { + if (kvp.key.equals("request.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("request.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers).containsKey("x-goog-api-version"); + assertThat(headers).containsKey("x-goog-api-client"); + } + } + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(4); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + for (KeyValuePair kvp : keyValuePairs2) { + if (kvp.key.equals("response.payload")) { + Map payload = (Map) kvp.value; + assertThat(payload.get("content")).isEqualTo(ECHO_STRING); + assertThat(payload.get("requestId")).isNotNull(); + assertThat(payload.get("otherRequestId")).isNotNull(); + } + if (kvp.key.equals("response.headers")) { + Map headers = (Map) kvp.value; + assertThat(headers.size()).isEqualTo(11); + } + } + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs = loggingEvent1.getKeyValuePairs(); + assertThat(keyValuePairs.size()).isEqualTo(2); + assertThat(keyValuePairs).contains(RPC_NAME_KEY_VALUE_PAIR); + assertThat(keyValuePairs).contains(REQUEST_URL_KEY_VALUE_PAIR); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + List keyValuePairs2 = loggingEvent2.getKeyValuePairs(); + assertThat(keyValuePairs2.size()).isEqualTo(2); + assertThat(keyValuePairs2) + .containsAtLeast(RESPONSE_STATUS_KEY_VALUE_PAIR_HTTP, RPC_NAME_KEY_VALUE_PAIR); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java new file mode 100644 index 0000000000..d0dec4b80d --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLogging1x.java @@ -0,0 +1,217 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.api.gax.httpjson.HttpJsonLoggingInterceptor; +import com.google.common.collect.ImmutableMap; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// This test needs to run with GOOGLE_SDK_JAVA_LOGGING=true +// mvn verify -P +// '!showcase,enable-integration-tests,loggingTestBase,slf4j1_logback ' +public class ITLogging1x { + private static EchoClient grpcClient; + + private static EchoClient httpjsonClient; + + private static final String ECHO_STRING = "echo?"; + private static final String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + private static final String RPC_NAME = "google.showcase.v1beta1.Echo/Echo"; + private static final String ENDPOINT = "http://localhost:7469"; + private static final String SENDING_REQUEST_MESSAGE = "Sending request"; + private static final String RECEIVING_RESPONSE_MESSAGE = "Received response"; + + private static Logger logger = LoggerFactory.getLogger(ITLogging1x.class); + + private TestAppender setupTestLogger(Class clazz, Level level) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(level); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + // Create Http JSON Echo Client + httpjsonClient = TestClientInitializer.createHttpJsonEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + httpjsonClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + httpjsonClient.awaitTermination( + TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + @Test + void test() { + assertThat(logger.isInfoEnabled()).isTrue(); + assertThat(logger.isDebugEnabled()).isTrue(); + } + + @Test + void testGrpc_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.DEBUG); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + + testAppender.stop(); + } + + @Test + void testGrpc_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class, Level.INFO); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of("serviceName", SERVICE_NAME, "rpcName", RPC_NAME)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "serviceName", SERVICE_NAME, "rpcName", RPC_NAME, "response.status", "OK")); + + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logDebug() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.DEBUG); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.DEBUG); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap).containsEntry("rpcName", RPC_NAME); + assertThat(mdcPropertyMap).containsEntry("request.url", ENDPOINT); + assertThat(mdcPropertyMap).containsKey("request.headers"); + assertThat(mdcPropertyMap.get("request.headers")).startsWith("{\"x-goog-api-"); + assertThat(mdcPropertyMap).containsKey("request.payload"); + assertThat(mdcPropertyMap.get("request.payload")) + .startsWith("{\"content\":\"echo?\",\"requestId\":"); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.DEBUG); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsAtLeastEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + assertThat(responseMdcPropertyMap).containsKey("response.payload"); + assertThat(responseMdcPropertyMap).containsKey("response.headers"); + testAppender.stop(); + } + + @Test + void testHttpJson_receiveContent_logInfo() { + TestAppender testAppender = setupTestLogger(HttpJsonLoggingInterceptor.class, Level.INFO); + assertThat(echoHttpJson(ECHO_STRING)).isEqualTo(ECHO_STRING); + assertThat(testAppender.events.size()).isEqualTo(2); + // logging event for request + ILoggingEvent loggingEvent1 = testAppender.events.get(0); + assertThat(loggingEvent1.getMessage()).isEqualTo(SENDING_REQUEST_MESSAGE); + assertThat(loggingEvent1.getLevel()).isEqualTo(Level.INFO); + Map mdcPropertyMap = loggingEvent1.getMDCPropertyMap(); + assertThat(mdcPropertyMap) + .containsExactlyEntriesIn( + ImmutableMap.of( + "rpcName", RPC_NAME, + "request.url", ENDPOINT)); + + // logging event for response + ILoggingEvent loggingEvent2 = testAppender.events.get(1); + assertThat(loggingEvent2.getMessage()).isEqualTo(RECEIVING_RESPONSE_MESSAGE); + assertThat(loggingEvent2.getLevel()).isEqualTo(Level.INFO); + Map responseMdcPropertyMap = loggingEvent2.getMDCPropertyMap(); + assertThat(responseMdcPropertyMap) + .containsExactlyEntriesIn(ImmutableMap.of("rpcName", RPC_NAME, "response.status", "200")); + testAppender.stop(); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } + + private String echoHttpJson(String value) { + EchoResponse response = httpjsonClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java new file mode 100644 index 0000000000..16c6acb0a6 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/ITLoggingDisabled.java @@ -0,0 +1,78 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.logging; + +import static com.google.common.truth.Truth.assertThat; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import com.google.api.gax.grpc.GrpcLoggingInterceptor; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoRequest; +import com.google.showcase.v1beta1.EchoResponse; +import com.google.showcase.v1beta1.it.util.TestClientInitializer; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; + +// mvn verify -P '!showcase,enable-integration-tests,loggingTestBase,disabledLogging' +public class ITLoggingDisabled { + + private static EchoClient grpcClient; + private static final String ECHO_STRING = "echo?"; + + private TestAppender setupTestLogger(Class clazz) { + TestAppender testAppender = new TestAppender(); + testAppender.start(); + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + org.slf4j.Logger logger = LoggerFactory.getLogger(clazz); + ((ch.qos.logback.classic.Logger) logger).setLevel(Level.DEBUG); + ((ch.qos.logback.classic.Logger) logger).addAppender(testAppender); + return testAppender; + } + + @BeforeAll + static void createClients() throws Exception { + // Create gRPC Echo Client + grpcClient = TestClientInitializer.createGrpcEchoClient(); + } + + @AfterAll + static void destroyClients() throws InterruptedException { + grpcClient.close(); + + grpcClient.awaitTermination(TestClientInitializer.AWAIT_TERMINATION_SECONDS, TimeUnit.SECONDS); + } + + // only run when GOOGLE_SDK_JAVA_LOGGING!=true + @Test + void testloggingDisabled() { + TestAppender testAppender = setupTestLogger(GrpcLoggingInterceptor.class); + assertThat(echoGrpc(ECHO_STRING)).isEqualTo(ECHO_STRING); + + assertThat(testAppender.events.size()).isEqualTo(0); + } + + private String echoGrpc(String value) { + EchoResponse response = grpcClient.echo(EchoRequest.newBuilder().setContent(value).build()); + return response.getContent(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java new file mode 100644 index 0000000000..92a6996936 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/logging/TestAppender.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.logging; + +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import java.util.ArrayList; +import java.util.List; + +/** Logback appender used to set up tests. */ +public class TestAppender extends AppenderBase { + public List events = new ArrayList<>(); + + @Override + protected void append(ILoggingEvent eventObject) { + // triggering Logback to capture the current MDC context and store it with the log event + // the default ListAppender does not capture MDC contents + eventObject.getMDCPropertyMap(); + + events.add(eventObject); + } + + public void clearEvents() { + events.clear(); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java new file mode 100644 index 0000000000..e7d2a01f56 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/GrpcCapturingClientInterceptor.java @@ -0,0 +1,83 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.util; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.Status; + +/** Implements a client interceptor to retrieve the metadata from a GRPC client request. */ +public class GrpcCapturingClientInterceptor implements ClientInterceptor { + public Metadata metadata; + + @Override + public ClientCall interceptCall( + MethodDescriptor method, final CallOptions callOptions, Channel next) { + ClientCall call = next.newCall(method, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(call) { + @Override + public void start(Listener responseListener, Metadata headers) { + Listener wrappedListener = + new SimpleForwardingClientCallListener(responseListener) { + @Override + public void onClose(Status status, Metadata trailers) { + if (status.isOk()) { + metadata = trailers; + } + super.onClose(status, trailers); + } + }; + + super.start(wrappedListener, headers); + } + }; + } + + private static class SimpleForwardingClientCallListener + extends ClientCall.Listener { + private final ClientCall.Listener delegate; + + SimpleForwardingClientCallListener(ClientCall.Listener delegate) { + this.delegate = delegate; + } + + @Override + public void onHeaders(Metadata headers) { + delegate.onHeaders(headers); + } + + @Override + public void onMessage(RespT message) { + delegate.onMessage(message); + } + + @Override + public void onClose(Status status, Metadata trailers) { + delegate.onClose(status, trailers); + } + + @Override + public void onReady() { + delegate.onReady(); + } + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java new file mode 100644 index 0000000000..ec9b9da9cb --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/HttpJsonCapturingClientInterceptor.java @@ -0,0 +1,66 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.util; + +import com.google.api.gax.httpjson.ApiMethodDescriptor; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCall; +import com.google.api.gax.httpjson.ForwardingHttpJsonClientCallListener; +import com.google.api.gax.httpjson.HttpJsonCallOptions; +import com.google.api.gax.httpjson.HttpJsonChannel; +import com.google.api.gax.httpjson.HttpJsonClientCall; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +import com.google.api.gax.httpjson.HttpJsonMetadata; + +/** Implements a client interceptor to retrieve the response headers from a HTTP client request. */ +public class HttpJsonCapturingClientInterceptor implements HttpJsonClientInterceptor { + public HttpJsonMetadata metadata; + + @Override + public HttpJsonClientCall interceptCall( + ApiMethodDescriptor method, + HttpJsonCallOptions callOptions, + HttpJsonChannel next) { + HttpJsonClientCall call = next.newCall(method, callOptions); + return new ForwardingHttpJsonClientCall.SimpleForwardingHttpJsonClientCall( + call) { + @Override + public void start(Listener responseListener, HttpJsonMetadata requestHeaders) { + Listener forwardingResponseListener = + new ForwardingHttpJsonClientCallListener.SimpleForwardingHttpJsonClientCallListener< + ResponseT>(responseListener) { + @Override + public void onHeaders(HttpJsonMetadata responseHeaders) { + metadata = responseHeaders; + super.onHeaders(responseHeaders); + } + + @Override + public void onMessage(ResponseT message) { + super.onMessage(message); + } + + @Override + public void onClose(int statusCode, HttpJsonMetadata trailers) { + super.onClose(statusCode, trailers); + } + }; + + super.start(forwardingResponseListener, requestHeaders); + } + }; + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java new file mode 100644 index 0000000000..4545d87f20 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransport.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.util; + +import com.google.api.client.http.LowLevelHttpRequest; +import com.google.api.client.json.JsonFactory; +import com.google.api.client.json.gson.GsonFactory; +import com.google.api.client.json.webtoken.JsonWebSignature; +import com.google.api.client.testing.http.MockLowLevelHttpRequest; +import com.google.auth.TestUtils; +import com.google.auth.oauth2.MockTokenServerTransport; +import java.io.IOException; +import java.util.Map; + +public class InterceptingMockTokenServerTransport extends MockTokenServerTransport { + private MockLowLevelHttpRequest lastRequest; + private static final JsonFactory JSON_FACTORY = new GsonFactory(); + + @Override + public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { + MockLowLevelHttpRequest baseRequest = (MockLowLevelHttpRequest) super.buildRequest(method, url); + lastRequest = baseRequest; + return baseRequest; + } + + public String getLastAudienceSent() throws IOException { + String contentString = lastRequest.getContentAsString(); + Map query = TestUtils.parseQuery(contentString); + String assertion = query.get("assertion"); + JsonWebSignature signature = JsonWebSignature.parse(JSON_FACTORY, assertion); + String foundTargetAudience = (String) signature.getPayload().get("api_audience"); + return foundTargetAudience; + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java new file mode 100644 index 0000000000..ffb1e04132 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/InterceptingMockTokenServerTransportFactory.java @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.util; + +import com.google.api.client.http.HttpTransport; +import com.google.auth.oauth2.MockTokenServerTransportFactory; + +public class InterceptingMockTokenServerTransportFactory extends MockTokenServerTransportFactory { + + public InterceptingMockTokenServerTransport transport = + new InterceptingMockTokenServerTransport(); + + @Override + public HttpTransport create() { + return transport; + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java new file mode 100644 index 0000000000..a3db1a00e3 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/java/com/google/showcase/v1beta1/it/util/TestClientInitializer.java @@ -0,0 +1,343 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.util; + +import com.google.api.client.http.javanet.NetHttpTransport; +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.httpjson.HttpJsonClientInterceptor; +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.StatusCode; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.tracing.ApiTracerFactory; +import com.google.common.collect.ImmutableList; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceSettings; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.EchoSettings; +import com.google.showcase.v1beta1.IdentityClient; +import com.google.showcase.v1beta1.IdentitySettings; +import com.google.showcase.v1beta1.WaitRequest; +import com.google.showcase.v1beta1.stub.EchoStub; +import com.google.showcase.v1beta1.stub.EchoStubSettings; +import io.grpc.ClientInterceptor; +import io.grpc.ManagedChannelBuilder; +import java.util.List; +import java.util.Set; + +public class TestClientInitializer { + + public static final int AWAIT_TERMINATION_SECONDS = 10; + + // gRPC's endpoint must follow the format of {host}:{port} + public static final String DEFAULT_GRPC_ENDPOINT = "localhost:7469"; + // httpjson's endpoint uses `https://` by default if the scheme is not specified + // local test requires `http://` as not SSL/TLS has been set up for showcase + public static final String DEFAULT_HTTPJSON_ENDPOINT = "http://localhost:7469"; + + public static EchoClient createGrpcEchoClient() throws Exception { + return createGrpcEchoClient(ImmutableList.of()); + } + + public static EchoClient createGrpcEchoClient(List interceptorList) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createGrpcEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClient() throws Exception { + return createHttpJsonEchoClient(ImmutableList.of()); + } + + public static EchoClient createHttpJsonEchoClient(List interceptorList) + throws Exception { + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientWithRetrySettings( + RetrySettings retrySettings, + Set retryableCodes, + List interceptorList) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .echoSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setInterceptorProvider(() -> interceptorList) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomBlockSettings( + RetrySettings retrySettings, Set retryableCodes) throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .blockSettings() + .setRetrySettings(retrySettings) + .setRetryableCodes(retryableCodes); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static EchoClient createGrpcEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder grpcEchoSettingsBuilder = EchoStubSettings.newBuilder(); + grpcEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings grpcEchoSettings = EchoSettings.create(grpcEchoSettingsBuilder.build()); + grpcEchoSettings = + grpcEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return EchoClient.create(grpcEchoSettings); + } + + public static EchoClient createHttpJsonEchoClientCustomWaitSettings( + RetrySettings initialUnaryRetrySettings, RetrySettings pollingRetrySettings) + throws Exception { + EchoStubSettings.Builder httpJsonEchoSettingsBuilder = EchoStubSettings.newHttpJsonBuilder(); + httpJsonEchoSettingsBuilder + .waitOperationSettings() + .setInitialCallSettings( + UnaryCallSettings.newUnaryCallSettingsBuilder() + .setRetrySettings(initialUnaryRetrySettings) + .build()) + .setPollingAlgorithm(OperationTimedPollAlgorithm.create(pollingRetrySettings)); + EchoSettings httpJsonEchoSettings = EchoSettings.create(httpJsonEchoSettingsBuilder.build()); + httpJsonEchoSettings = + httpJsonEchoSettings.toBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return EchoClient.create(httpJsonEchoSettings); + } + + public static IdentityClient createGrpcIdentityClient() throws Exception { + IdentitySettings grpcIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + IdentitySettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return IdentityClient.create(grpcIdentitySettings); + } + + public static IdentityClient createHttpJsonIdentityClient() throws Exception { + IdentitySettings httpjsonIdentitySettings = + IdentitySettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + return IdentityClient.create(httpjsonIdentitySettings); + } + + // Create grpcComplianceClient with Interceptor + public static ComplianceClient createGrpcComplianceClient(List interceptorList) + throws Exception { + ComplianceSettings grpcComplianceSettings = + ComplianceSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + ComplianceSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .setInterceptorProvider(() -> interceptorList) + .build()) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + return ComplianceClient.create(grpcComplianceSettings); + } + + public static ComplianceClient createHttpJsonComplianceClient( + List interceptorList) throws Exception { + ComplianceSettings httpJsonComplianceSettings = + ComplianceSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .setInterceptorProvider(() -> interceptorList) + .build()) + .build(); + return ComplianceClient.create(httpJsonComplianceSettings); + } + + public static EchoClient createGrpcEchoClientOpentelemetry(ApiTracerFactory metricsTracerFactory) + throws Exception { + return createGrpcEchoClientOpentelemetry( + metricsTracerFactory, + EchoSettings.defaultGrpcTransportProviderBuilder() + .setChannelConfigurator(ManagedChannelBuilder::usePlaintext) + .build()); + } + + public static EchoClient createGrpcEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory, TransportChannelProvider transportChannelProvider) + throws Exception { + EchoSettings grpcEchoSettings = + EchoSettings.newBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider(transportChannelProvider) + .setEndpoint(DEFAULT_GRPC_ENDPOINT) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + grpcEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } + + public static EchoClient createHttpJsonEchoClientOpentelemetry( + ApiTracerFactory metricsTracerFactory) throws Exception { + + EchoSettings httpJsonEchoSettings = + EchoSettings.newHttpJsonBuilder() + .setCredentialsProvider(NoCredentialsProvider.create()) + .setTransportChannelProvider( + EchoSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport( + new NetHttpTransport.Builder().doNotValidateCertificate().build()) + .setEndpoint(DEFAULT_HTTPJSON_ENDPOINT) + .build()) + .build(); + + EchoStubSettings echoStubSettings = + (EchoStubSettings) + httpJsonEchoSettings.getStubSettings().toBuilder() + .setTracerFactory(metricsTracerFactory) + .build(); + EchoStub stub = echoStubSettings.createStub(); + + return EchoClient.create(stub); + } +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json b/java-showcase-3.21.0/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json new file mode 100644 index 0000000000..bfa2659f0a --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/META-INF/native-image/resource-config.json @@ -0,0 +1,6 @@ +{ + "resources": [ + { "pattern": ".*.json" }, + { "pattern": ".*.pem" } + ] +} \ No newline at end of file diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/compliance_suite.json b/java-showcase-3.21.0/gapic-showcase/src/test/resources/compliance_suite.json new file mode 100644 index 0000000000..a458819b35 --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/compliance_suite.json @@ -0,0 +1,240 @@ +{ + "group": [ + { + "name": "Fully working conversions, no resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery", "Compliance.RepeatDataSimplePath", "Compliance.RepeatDataBodyInfo"], + "requests": [ + { + "name": "Basic data types", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "pString": "Goodbye", + "pInt32": -37, + "pDouble": -41.43, + "pBool": true, + "pKingdom": "PLANTAE", + + "fChild": { + "fString": "second/bool/salutation" + } + }, + "fInt32": -10, + "fInt64": -110, + "fDouble": -54e4, + + "pInt32": -47, + "pInt64": -477, + "pDouble": -61.73 + }, + { + "name": "Basic types, no optional fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": -1, + "fSint32" : -2, + "fSfixed32": -3, + "fUint32": 5, + "fFixed32": 7, + "fInt64": -11, + "fSint64": -13, + "fSfixed64": -17, + "fUint64": 19, + "fFixed64":23, + "fDouble": -29e4, + "fFloat": -31, + "fBool": true, + "fKingdom": "ANIMALIA", + + "fChild": { + "fString": "second/bool/salutation" + } + } + }, + + { + "name": "Zero values for non-string fields", + "serverVerify": true, + "info": { + "fString": "Hello", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64": 0, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + "fKingdom": "LIFE_KINGDOM_UNSPECIFIED", + + "pString": "Goodbye", + "pInt32": 0, + "pDouble": 0, + "pBool": false, + "pKingdom": "LIFE_KINGDOM_UNSPECIFIED" + } + }, + { + "name": "Extreme values", + "serverVerify": true, + "info": { + "fString": "non-ASCII+non-printable string ☺ → ← \"\\\/\b\f\r\t\u1234 works, not newlines yet", + "fInt32": 2147483647, + "fSint32" : 2147483647, + "fSfixed32": 2147483647, + "fUint32": 4294967295, + "fFixed32": 4294967295, + "fInt64": "9223372036854775807", + "fSint64": "9223372036854775807", + "fSfixed64": "9223372036854775807", + "fUint64": "18446744073709551615", + "fFixed64": "18446744073709551615", + "fDouble": 1.797693134862315708145274237317043567981e+308, + "fFloat": 3.40282346638528859811704183484516925440e+38, + "fBool": false, + + "pString": "Goodbye", + "pInt32": 2147483647, + "pDouble": 1.797693134862315708145274237317043567981e+308, + "pBool": false + } + }, + { + "name": "Strings with spaces", + "serverVerify": true, + "info": { + "fString": "Hello there" + } + }, + { + "name": "Strings with quotes", + "serverVerify": true, + "info": { + "fString": "Hello \"You\"" + } + }, + { + "name": "Strings with percents", + "serverVerify": true, + "info": { + "fString": "Hello 100%" + } + } + ] + }, + { + "name": "Fully working conversions, resources", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Strings with slashes and values that resemble subsequent resource templates", + "serverVerify": true, + "info": { + "fString": "first/hello/second/greetings", + "pBool": true, + + "fChild": { + "fString": "second/zzz/bool/true" + } + } + } + ] + }, + { + "name": "Binding selection testing", + "rpcs": ["Compliance.RepeatDataPathResource"], + "requests": [ + { + "name": "Binding testing baseline no Uri verification", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + } + }, + { + "name": "Binding testing first binding", + "serverVerify": true, + "info": { + "fString": "first/hello", + "pBool": true, + + "fChild": { + "fString": "second/greetings" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + }, + { + "name": "Binding testing additional binding", + "serverVerify": true, + "info": { + "fString": "second/greetings", + "pBool": true, + + "fChild": { + "fString": "first/hello" + } + }, + "intendedBindingUri": "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + ] + }, + { + "name": "Cases that apply to non-path requests", + "rpcs": ["Compliance.RepeatDataBody", "Compliance.RepeatDataBodyPut", "Compliance.RepeatDataBodyPatch", "Compliance.RepeatDataQuery"], + "requests": [ + { + "name": "Zero values for all fields", + "serverVerify": true, + "info": { + "fString": "", + "fInt32": 0, + "fSint32" : 0, + "fSfixed32": 0, + "fUint32": 0, + "fFixed32": 0, + "fInt64": 0, + "fSint64": 0, + "fSfixed64": 0, + "fUint64": 0, + "fFixed64":20, + "fDouble": 0, + "fFloat": 0, + "fBool": false, + + "pString": "", + "pInt32": 0, + "pDouble": 0, + "pBool": false + } + } + ] + } + ] +} diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/fake_cert.pem b/java-showcase-3.21.0/gapic-showcase/src/test/resources/fake_cert.pem new file mode 100644 index 0000000000..03febfd3ae --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/fake_cert.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICUTCCAfugAwIBAgIBADANBgkqhkiG9w0BAQQFADBXMQswCQYDVQQGEwJDTjEL +MAkGA1UECBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMC +VU4xFDASBgNVBAMTC0hlcm9uZyBZYW5nMB4XDTA1MDcxNTIxMTk0N1oXDTA1MDgx +NDIxMTk0N1owVzELMAkGA1UEBhMCQ04xCzAJBgNVBAgTAlBOMQswCQYDVQQHEwJD +TjELMAkGA1UEChMCT04xCzAJBgNVBAsTAlVOMRQwEgYDVQQDEwtIZXJvbmcgWWFu +ZzBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQCp5hnG7ogBhtlynpOS21cBewKE/B7j +V14qeyslnr26xZUsSVko36ZnhiaO/zbMOoRcKK9vEcgMtcLFuQTWDl3RAgMBAAGj +gbEwga4wHQYDVR0OBBYEFFXI70krXeQDxZgbaCQoR4jUDncEMH8GA1UdIwR4MHaA +FFXI70krXeQDxZgbaCQoR4jUDncEoVukWTBXMQswCQYDVQQGEwJDTjELMAkGA1UE +CBMCUE4xCzAJBgNVBAcTAkNOMQswCQYDVQQKEwJPTjELMAkGA1UECxMCVU4xFDAS +BgNVBAMTC0hlcm9uZyBZYW5nggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEE +BQADQQA/ugzBrjjK9jcWnDVfGHlk3icNRq0oV7Ri32z/+HQX67aRfgZu7KWdI+Ju +Wm7DCfrPNGVwFWUQOmsPue9rZBgO +-----END CERTIFICATE----- diff --git a/java-showcase-3.21.0/gapic-showcase/src/test/resources/test_gdch_credential.json b/java-showcase-3.21.0/gapic-showcase/src/test/resources/test_gdch_credential.json new file mode 100644 index 0000000000..16c2582cdc --- /dev/null +++ b/java-showcase-3.21.0/gapic-showcase/src/test/resources/test_gdch_credential.json @@ -0,0 +1,10 @@ +{ + "type": "gdch_service_account", + "format_version": "1", + "project": "project-id", + "private_key_id": "d84a4fefcf50791d4a90f2d7af17469d6282df9d", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALX0PQoe1igW12i\nkv1bN/r9lN749y2ijmbc/mFHPyS3hNTyOCjDvBbXYbDhQJzWVUikh4mvGBA07qTj79Xc3yBDfKP2IeyYQIFe0t0\nzkd7R9Zdn98Y2rIQC47aAbDfubtkU1U72t4zL11kHvoa0/RuFZjncvlr42X7be7lYh4p3NAgMBAAECgYASk5wDw\n4Az2ZkmeuN6Fk/y9H+Lcb2pskJIXjrL533vrDWGOC48LrsThMQPv8cxBky8HFSEklPpkfTF95tpD43iVwJRB/Gr\nCtGTw65IfJ4/tI09h6zGc4yqvIo1cHX/LQ+SxKLGyir/dQM925rGt/VojxY5ryJR7GLbCzxPnJm/oQJBANwOCO6\nD2hy1LQYJhXh7O+RLtA/tSnT1xyMQsGT+uUCMiKS2bSKx2wxo9k7h3OegNJIu1q6nZ6AbxDK8H3+d0dUCQQDTrP\nSXagBxzp8PecbaCHjzNRSQE2in81qYnrAFNB4o3DpHyMMY6s5ALLeHKscEWnqP8Ur6X4PvzZecCWU9BKAZAkAut\nLPknAuxSCsUOvUfS1i87ex77Ot+w6POp34pEX+UWb+u5iFn2cQacDTHLV1LtE80L8jVLSbrbrlH43H0DjU5AkEA\ngidhycxS86dxpEljnOMCw8CKoUBd5I880IUahEiUltk7OLJYS/Ts1wbn3kPOVX3wyJs8WBDtBkFrDHW2ezth2QJ\nADj3e1YhMVdjJW5jqwlD/VNddGjgzyunmiZg0uOXsHXbytYmsA545S8KRQFaJKFXYYFo2kOjqOiC1T2cAzMDjCQ\n==\n-----END PRIVATE KEY-----\n", + "name": "service-identity-name", + "ca_cert_path": "fake-cert-path", + "token_uri": "https://service-identity.fake-domain/authenticate" +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 0000000000..731f7543e2 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,8 @@ + + + + 7012 + com/google/showcase/v1beta1/EchoGrpc$AsyncService + *failEchoWithDetails(*) + + diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/pom.xml b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..9fce31015f --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + grpc-gapic-showcase-v1beta1 + GRPC library for grpc-google-cloud-iot-v1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + 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 + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java new file mode 100644 index 0000000000..5c42138987 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -0,0 +1,1638 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *

+ * 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.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class ComplianceGrpc { + + private ComplianceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Compliance"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyInfoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataQueryMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataSimplePathMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataPathTrailingResourceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPutMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyPatchMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.RepeatRequest, com.google.showcase.v1beta1.RepeatResponse> + 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< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + 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< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + getGetEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumRequest, com.google.showcase.v1beta1.EnumResponse> + 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< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + 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< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + getVerifyEnumMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse> + 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 all types of calls on the service */ + public static ComplianceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public ComplianceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + }; + return ComplianceBlockingV2Stub.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); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the entire request object in the REST body.
+     * 
+ */ + default void repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyInfoMethod(), responseObserver); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending all request fields as query parameters.
+     * 
+ */ + default void repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataQueryMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataSimplePathMethod(), responseObserver); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a path resource.
+     * 
+ */ + default void repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathResourceMethod(), responseObserver); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a trailing resource.
+     * 
+ */ + default void repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataPathTrailingResourceMethod(), responseObserver); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PUT method.
+     * 
+ */ + default void repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPutMethod(), responseObserver); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PATCH method.
+     * 
+ */ + default void repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyPatchMethod(), responseObserver); + } + + /** + * + * + *
+     * 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 values 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.
+     * 
+ */ + default void getEnum( + com.google.showcase.v1beta1.EnumRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetEnumMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void verifyEnum( + com.google.showcase.v1beta1.EnumResponse request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Compliance. + * + *
+   * 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.
+   * 
+ */ + public abstract static class ComplianceImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return ComplianceGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Compliance. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the entire request object in the REST body.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending all request fields as query parameters.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a path resource.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a trailing resource.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PUT method.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PATCH method.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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 values 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Compliance. + * + *
+   * 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.
+   * 
+ */ + public static final class ComplianceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private ComplianceBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected ComplianceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new ComplianceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the entire request object in the REST body.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending all request fields as query parameters.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a path resource.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a trailing resource.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PUT method.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PATCH method.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 values 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.
+     * 
+ */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Compliance. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the entire request object in the REST body.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBody( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyInfo( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyInfoMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending all request fields as query parameters.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataQuery( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataQueryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataSimplePath( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataSimplePathMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a path resource.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a trailing resource.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataPathTrailingResource( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataPathTrailingResourceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PUT method.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPut( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPutMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PATCH method.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch( + com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyPatchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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 values 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.
+     * 
+ */ + public com.google.showcase.v1beta1.EnumResponse getEnum( + com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetEnumMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.EnumResponse verifyEnum( + com.google.showcase.v1beta1.EnumResponse request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyEnumMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Compliance. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending the entire request object in the REST body.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBody(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyInfo(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyInfoMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending all request fields as query parameters.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataQuery(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataQueryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataSimplePath(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataSimplePathMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a path resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathResourceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Same as RepeatDataSimplePath, but with a trailing resource.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataPathTrailingResource(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataPathTrailingResourceMethod(), getCallOptions()), + request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PUT method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPut(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPutMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * This method echoes the ComplianceData request, using the HTTP PATCH method.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyPatch(com.google.showcase.v1beta1.RepeatRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyPatchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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 values 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + getEnum(com.google.showcase.v1beta1.EnumRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetEnumMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EnumResponse> + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + 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>( + service, METHODID_REPEAT_DATA_BODY))) + .addMethod( + getRepeatDataBodyInfoMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_INFO))) + .addMethod( + getRepeatDataQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_QUERY))) + .addMethod( + getRepeatDataSimplePathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_SIMPLE_PATH))) + .addMethod( + getRepeatDataPathResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_PATH_RESOURCE))) + .addMethod( + getRepeatDataPathTrailingResourceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, 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>( + service, METHODID_REPEAT_DATA_BODY_PUT))) + .addMethod( + getRepeatDataBodyPatchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.RepeatRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_PATCH))) + .addMethod( + getGetEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumRequest, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_GET_ENUM))) + .addMethod( + getVerifyEnumMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EnumResponse, + com.google.showcase.v1beta1.EnumResponse>(service, METHODID_VERIFY_ENUM))) + .build(); + } + + private abstract static 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 java.lang.String methodName; + + ComplianceMethodDescriptorSupplier(java.lang.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/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java new file mode 100644 index 0000000000..0d30b3d3e2 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java @@ -0,0 +1,1770 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * 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.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class EchoGrpc { + + private EchoGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Echo"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getEchoMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "EchoErrorDetails", + requestType = com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + responseType = com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + getEchoErrorDetailsMethod; + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getEchoErrorDetailsMethod = EchoGrpc.getEchoErrorDetailsMethod) == null) { + EchoGrpc.getEchoErrorDetailsMethod = + getEchoErrorDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "EchoErrorDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.EchoErrorDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("EchoErrorDetails")) + .build(); + } + } + } + return getEchoErrorDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "FailEchoWithDetails", + requestType = com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + responseType = com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + getFailEchoWithDetailsMethod; + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + synchronized (EchoGrpc.class) { + if ((getFailEchoWithDetailsMethod = EchoGrpc.getFailEchoWithDetailsMethod) == null) { + EchoGrpc.getFailEchoWithDetailsMethod = + getFailEchoWithDetailsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "FailEchoWithDetails")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new EchoMethodDescriptorSupplier("FailEchoWithDetails")) + .build(); + } + } + } + return getFailEchoWithDetailsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + getExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ExpandRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getCollectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + getChatMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + 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< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + 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< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + 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< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + 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< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + getPagedExpandLegacyMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse> + 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< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + 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< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + getPagedExpandLegacyMappedMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + 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< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + 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< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + getWaitMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation> + 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< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + 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< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + getBlockMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.BlockRequest, com.google.showcase.v1beta1.BlockResponse> + 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 all types of calls on the service */ + public static EchoBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public EchoBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + }; + return EchoBlockingV2Stub.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); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * This method simply echoes the request. This method showcases unary RPCs.
+     * 
+ */ + default void echo( + com.google.showcase.v1beta1.EchoRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getEchoMethod(), responseObserver); + } + + /** + * + * + *
+     * This method returns error details in a repeated "google.protobuf.Any"
+     * field. This method showcases handling errors thus encoded, particularly
+     * over REST transport. Note that GAPICs only allow the type
+     * "google.protobuf.Any" for field paths ending in "error.details", and, at
+     * run-time, the actual types for these fields must be one of the types in
+     * google/rpc/error_details.proto.
+     * 
+ */ + default void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getEchoErrorDetailsMethod(), responseObserver); + } + + /** + * + * + *
+     * This method always fails with a gRPC "Aborted" error status that contains
+     * multiple error details.  These include one instance of each of the standard
+     * ones in error_details.proto
+     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
+     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
+     * verify that GAPICs can process these various error details and surface them
+     * to the user in an idiomatic form.
+     * 
+ */ + default void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getFailEchoWithDetailsMethod(), responseObserver); + } + + /** + * + * + *
+     * This method splits the given content into words and will pass each word back
+     * through the stream. This method showcases server-side streaming RPCs.
+     * 
+ */ + default void expand( + com.google.showcase.v1beta1.ExpandRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getExpandMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getCollectMethod(), responseObserver); + } + + /** + * + * + *
+     * This method, upon receiving a request on the stream, will pass the same
+     * content back on the stream. This method showcases bidirectional
+     * streaming RPCs.
+     * 
+ */ + default io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getChatMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getPagedExpandLegacyMappedMethod(), responseObserver); + } + + /** + * + * + *
+     * This method will wait for the requested amount of time and then return.
+     * This method showcases how a client handles a request timeout.
+     * 
+ */ + default void wait( + com.google.showcase.v1beta1.WaitRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWaitMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void block( + com.google.showcase.v1beta1.BlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getBlockMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Echo. + * + *
+   * 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.
+   * 
+ */ + public abstract static class EchoImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return EchoGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Echo. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * This method simply echoes the request. This method showcases unary RPCs.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This method returns error details in a repeated "google.protobuf.Any"
+     * field. This method showcases handling errors thus encoded, particularly
+     * over REST transport. Note that GAPICs only allow the type
+     * "google.protobuf.Any" for field paths ending in "error.details", and, at
+     * run-time, the actual types for these fields must be one of the types in
+     * google/rpc/error_details.proto.
+     * 
+ */ + public void echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * This method always fails with a gRPC "Aborted" error status that contains
+     * multiple error details.  These include one instance of each of the standard
+     * ones in error_details.proto
+     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
+     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
+     * verify that GAPICs can process these various error details and surface them
+     * to the user in an idiomatic form.
+     * 
+ */ + public void failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * This method splits the given content into words and will pass each word back
+     * through the stream. This method showcases server-side streaming RPCs.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public io.grpc.stub.StreamObserver collect( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getCollectMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * This method, upon receiving a request on the stream, will pass the same
+     * content back on the stream. This method showcases bidirectional
+     * streaming RPCs.
+     * 
+ */ + public io.grpc.stub.StreamObserver chat( + io.grpc.stub.StreamObserver responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getChatMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This method will wait for the requested amount of time and then return.
+     * This method showcases how a client handles a request timeout.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Echo. + * + *
+   * 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.
+   * 
+ */ + public static final class EchoBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private EchoBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected EchoBlockingV2Stub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new EchoBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * This method simply echoes the request. This method showcases unary RPCs.
+     * 
+ */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method returns error details in a repeated "google.protobuf.Any"
+     * field. This method showcases handling errors thus encoded, particularly
+     * over REST transport. Note that GAPICs only allow the type
+     * "google.protobuf.Any" for field paths ending in "error.details", and, at
+     * run-time, the actual types for these fields must be one of the types in
+     * google/rpc/error_details.proto.
+     * 
+ */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method always fails with a gRPC "Aborted" error status that contains
+     * multiple error details.  These include one instance of each of the standard
+     * ones in error_details.proto
+     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
+     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
+     * verify that GAPICs can process these various error details and surface them
+     * to the user in an idiomatic form.
+     * 
+ */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method splits the given content into words and will pass each word back
+     * through the stream. This method showcases server-side streaming RPCs.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + collect() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getCollectMethod(), getCallOptions()); + } + + /** + * + * + *
+     * This method, upon receiving a request on the stream, will pass the same
+     * content back on the stream. This method showcases bidirectional
+     * streaming RPCs.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.EchoRequest, com.google.showcase.v1beta1.EchoResponse> + chat() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getChatMethod(), getCallOptions()); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method will wait for the requested amount of time and then return.
+     * This method showcases how a client handles a request timeout.
+     * 
+ */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Echo. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * This method simply echoes the request. This method showcases unary RPCs.
+     * 
+ */ + public com.google.showcase.v1beta1.EchoResponse echo( + com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method returns error details in a repeated "google.protobuf.Any"
+     * field. This method showcases handling errors thus encoded, particularly
+     * over REST transport. Note that GAPICs only allow the type
+     * "google.protobuf.Any" for field paths ending in "error.details", and, at
+     * run-time, the actual types for these fields must be one of the types in
+     * google/rpc/error_details.proto.
+     * 
+ */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( + com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getEchoErrorDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method always fails with a gRPC "Aborted" error status that contains
+     * multiple error details.  These include one instance of each of the standard
+     * ones in error_details.proto
+     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
+     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
+     * verify that GAPICs can process these various error details and surface them
+     * to the user in an idiomatic form.
+     * 
+ */ + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse failEchoWithDetails( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getFailEchoWithDetailsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method splits the given content into words and will pass each word back
+     * through the stream. This method showcases server-side streaming RPCs.
+     * 
+ */ + public java.util.Iterator expand( + com.google.showcase.v1beta1.ExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpand( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandResponse pagedExpandLegacy( + com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse pagedExpandLegacyMapped( + com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getPagedExpandLegacyMappedMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This method will wait for the requested amount of time and then return.
+     * This method showcases how a client handles a request timeout.
+     * 
+ */ + public com.google.longrunning.Operation wait(com.google.showcase.v1beta1.WaitRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getWaitMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.BlockResponse block( + com.google.showcase.v1beta1.BlockRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getBlockMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Echo. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * This method simply echoes the request. This method showcases unary RPCs.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoResponse> + echo(com.google.showcase.v1beta1.EchoRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * This method returns error details in a repeated "google.protobuf.Any"
+     * field. This method showcases handling errors thus encoded, particularly
+     * over REST transport. Note that GAPICs only allow the type
+     * "google.protobuf.Any" for field paths ending in "error.details", and, at
+     * run-time, the actual types for these fields must be one of the types in
+     * google/rpc/error_details.proto.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.EchoErrorDetailsResponse> + echoErrorDetails(com.google.showcase.v1beta1.EchoErrorDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getEchoErrorDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * This method always fails with a gRPC "Aborted" error status that contains
+     * multiple error details.  These include one instance of each of the standard
+     * ones in error_details.proto
+     * (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto)
+     * plus a custom, Showcase-defined PoetryError. The intent of this RPC is to
+     * verify that GAPICs can process these various error details and surface them
+     * to the user in an idiomatic form.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.FailEchoWithDetailsResponse> + failEchoWithDetails(com.google.showcase.v1beta1.FailEchoWithDetailsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getFailEchoWithDetailsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpand(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandResponse> + pagedExpandLegacy(com.google.showcase.v1beta1.PagedExpandLegacyRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse> + pagedExpandLegacyMapped(com.google.showcase.v1beta1.PagedExpandRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getPagedExpandLegacyMappedMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * This method will wait for the requested amount of time and then return.
+     * This method showcases how a client handles a request timeout.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.BlockResponse> + 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_ECHO_ERROR_DETAILS = 1; + private static final int METHODID_FAIL_ECHO_WITH_DETAILS = 2; + private static final int METHODID_EXPAND = 3; + private static final int METHODID_PAGED_EXPAND = 4; + private static final int METHODID_PAGED_EXPAND_LEGACY = 5; + private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 6; + private static final int METHODID_WAIT = 7; + private static final int METHODID_BLOCK = 8; + private static final int METHODID_COLLECT = 9; + private static final int METHODID_CHAT = 10; + + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_ECHO_ERROR_DETAILS: + serviceImpl.echoErrorDetails( + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_FAIL_ECHO_WITH_DETAILS: + serviceImpl.failEchoWithDetails( + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) 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< + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>) + 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + 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>(service, METHODID_ECHO))) + .addMethod( + getEchoErrorDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoErrorDetailsRequest, + com.google.showcase.v1beta1.EchoErrorDetailsResponse>( + service, METHODID_ECHO_ERROR_DETAILS))) + .addMethod( + getFailEchoWithDetailsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.FailEchoWithDetailsRequest, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse>( + service, METHODID_FAIL_ECHO_WITH_DETAILS))) + .addMethod( + getExpandMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ExpandRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_EXPAND))) + .addMethod( + getCollectMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_COLLECT))) + .addMethod( + getChatMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.EchoRequest, + com.google.showcase.v1beta1.EchoResponse>(service, METHODID_CHAT))) + .addMethod( + getPagedExpandMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND))) + .addMethod( + getPagedExpandLegacyMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandLegacyRequest, + com.google.showcase.v1beta1.PagedExpandResponse>( + service, METHODID_PAGED_EXPAND_LEGACY))) + .addMethod( + getPagedExpandLegacyMappedMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.PagedExpandRequest, + com.google.showcase.v1beta1.PagedExpandLegacyMappedResponse>( + service, METHODID_PAGED_EXPAND_LEGACY_MAPPED))) + .addMethod( + getWaitMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.WaitRequest, com.google.longrunning.Operation>( + service, METHODID_WAIT))) + .addMethod( + getBlockMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.BlockRequest, + com.google.showcase.v1beta1.BlockResponse>(service, METHODID_BLOCK))) + .build(); + } + + private abstract static 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 java.lang.String methodName; + + EchoMethodDescriptorSupplier(java.lang.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(getEchoErrorDetailsMethod()) + .addMethod(getFailEchoWithDetailsMethod()) + .addMethod(getExpandMethod()) + .addMethod(getCollectMethod()) + .addMethod(getChatMethod()) + .addMethod(getPagedExpandMethod()) + .addMethod(getPagedExpandLegacyMethod()) + .addMethod(getPagedExpandLegacyMappedMethod()) + .addMethod(getWaitMethod()) + .addMethod(getBlockMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java new file mode 100644 index 0000000000..bc0f6987e3 --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityGrpc.java @@ -0,0 +1,886 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A simple identity service.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class IdentityGrpc { + + private IdentityGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Identity"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + 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< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + getCreateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateUserRequest, com.google.showcase.v1beta1.User> + 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< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + 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< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + getGetUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User> + 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< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + 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< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + getUpdateUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateUserRequest, com.google.showcase.v1beta1.User> + 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< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + getDeleteUserMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + 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< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + getListUsersMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse> + 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 all types of calls on the service */ + public static IdentityBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public IdentityBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + }; + return IdentityBlockingV2Stub.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); + } + + /** + * + * + *
+   * A simple identity service.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a user.
+     * 
+ */ + default void createUser( + com.google.showcase.v1beta1.CreateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the User with the given uri.
+     * 
+ */ + default void getUser( + com.google.showcase.v1beta1.GetUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a user.
+     * 
+ */ + default void updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a user, their profile, and all of their authored messages.
+     * 
+ */ + default void deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteUserMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all users.
+     * 
+ */ + default void listUsers( + com.google.showcase.v1beta1.ListUsersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListUsersMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Identity. + * + *
+   * A simple identity service.
+   * 
+ */ + public abstract static class IdentityImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return IdentityGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Identity. + * + *
+   * A simple identity service.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a user.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves the User with the given uri.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Updates a user.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Deletes a user, their profile, and all of their authored messages.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists all users.
+     * 
+ */ + 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); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Identity. + * + *
+   * A simple identity service.
+   * 
+ */ + public static final class IdentityBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private IdentityBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected IdentityBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new IdentityBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a user.
+     * 
+ */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the User with the given uri.
+     * 
+ */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a user.
+     * 
+ */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a user, their profile, and all of their authored messages.
+     * 
+ */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all users.
+     * 
+ */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Identity. + * + *
+   * A simple identity service.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a user.
+     * 
+ */ + public com.google.showcase.v1beta1.User createUser( + com.google.showcase.v1beta1.CreateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the User with the given uri.
+     * 
+ */ + public com.google.showcase.v1beta1.User getUser( + com.google.showcase.v1beta1.GetUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a user.
+     * 
+ */ + public com.google.showcase.v1beta1.User updateUser( + com.google.showcase.v1beta1.UpdateUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a user, their profile, and all of their authored messages.
+     * 
+ */ + public com.google.protobuf.Empty deleteUser( + com.google.showcase.v1beta1.DeleteUserRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteUserMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all users.
+     * 
+ */ + public com.google.showcase.v1beta1.ListUsersResponse listUsers( + com.google.showcase.v1beta1.ListUsersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListUsersMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Identity. + * + *
+   * A simple identity service.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a user.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves the User with the given uri.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Updates a user.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Deletes a user, their profile, and all of their authored messages.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists all users.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListUsersResponse> + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + 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>(service, METHODID_CREATE_USER))) + .addMethod( + getGetUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetUserRequest, com.google.showcase.v1beta1.User>( + service, METHODID_GET_USER))) + .addMethod( + getUpdateUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateUserRequest, + com.google.showcase.v1beta1.User>(service, METHODID_UPDATE_USER))) + .addMethod( + getDeleteUserMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteUserRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_USER))) + .addMethod( + getListUsersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListUsersRequest, + com.google.showcase.v1beta1.ListUsersResponse>(service, METHODID_LIST_USERS))) + .build(); + } + + private abstract static 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 java.lang.String methodName; + + IdentityMethodDescriptorSupplier(java.lang.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/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java new file mode 100644 index 0000000000..48b744397b --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingGrpc.java @@ -0,0 +1,2004 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * 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.
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class MessagingGrpc { + + private MessagingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Messaging"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + 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< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + getCreateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateRoomRequest, com.google.showcase.v1beta1.Room> + 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< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + 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< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + getGetRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room> + 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< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + 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< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + getUpdateRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateRoomRequest, com.google.showcase.v1beta1.Room> + 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< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + getDeleteRoomMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + 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< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + getListRoomsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse> + 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< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + 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< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getCreateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, com.google.showcase.v1beta1.Blurb> + 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< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + 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< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + getGetBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb> + 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< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + 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< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + getUpdateBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.UpdateBlurbRequest, com.google.showcase.v1beta1.Blurb> + 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< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + getDeleteBlurbMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + 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< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + getListBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse> + 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< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + 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< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + getSearchBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.SearchBlurbsRequest, com.google.longrunning.Operation> + 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< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + 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< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getStreamBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + 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< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + 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< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + getSendBlurbsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + 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< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + 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< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + getConnectMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + 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 all types of calls on the service */ + public static MessagingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public MessagingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + }; + return MessagingBlockingV2Stub.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); + } + + /** + * + * + *
+   * 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.
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a room.
+     * 
+ */ + default void createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCreateRoomMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the Room with the given resource name.
+     * 
+ */ + default void getRoom( + com.google.showcase.v1beta1.GetRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetRoomMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a room.
+     * 
+ */ + default void updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getUpdateRoomMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a room and all of its blurbs.
+     * 
+ */ + default void deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteRoomMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists all chat rooms.
+     * 
+ */ + default void listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListRoomsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateBlurbMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves the Blurb with the given resource name.
+     * 
+ */ + default void getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetBlurbMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a blurb.
+     * 
+ */ + default void updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateBlurbMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a blurb.
+     * 
+ */ + default void deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteBlurbMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists blurbs for a specific chat room or user profile depending on the
+     * parent resource name.
+     * 
+ */ + default void listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListBlurbsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchBlurbsMethod(), responseObserver); + } + + /** + * + * + *
+     * This returns a stream that emits the blurbs that are created for a
+     * particular chat room or user profile.
+     * 
+ */ + default void streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getStreamBlurbsMethod(), responseObserver); + } + + /** + * + * + *
+     * This is a stream to create multiple blurbs. If an invalid blurb is
+     * requested to be created, the stream will close with an error.
+     * 
+ */ + default io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getSendBlurbsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getConnectMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Messaging. + * + *
+   * 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.
+   * 
+ */ + public abstract static class MessagingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return MessagingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Messaging. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a room.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves the Room with the given resource name.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Updates a room.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Deletes a room and all of its blurbs.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists all chat rooms.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves the Blurb with the given resource name.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Updates a blurb.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Deletes a blurb.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists blurbs for a specific chat room or user profile depending on the
+     * parent resource name.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This returns a stream that emits the blurbs that are created for a
+     * particular chat room or user profile.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * This is a stream to create multiple blurbs. If an invalid blurb is
+     * requested to be created, the stream will close with an error.
+     * 
+ */ + public io.grpc.stub.StreamObserver sendBlurbs( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncClientStreamingCall( + getChannel().newCall(getSendBlurbsMethod(), getCallOptions()), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public io.grpc.stub.StreamObserver connect( + io.grpc.stub.StreamObserver + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getConnectMethod(), getCallOptions()), responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Messaging. + * + *
+   * 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.
+   * 
+ */ + public static final class MessagingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private MessagingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected MessagingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MessagingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a room.
+     * 
+ */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the Room with the given resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a room.
+     * 
+ */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a room and all of its blurbs.
+     * 
+ */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all chat rooms.
+     * 
+ */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the Blurb with the given resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a blurb.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a blurb.
+     * 
+ */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists blurbs for a specific chat room or user profile depending on the
+     * parent resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This returns a stream that emits the blurbs that are created for a
+     * particular chat room or user profile.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall + streamBlurbs(com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This is a stream to create multiple blurbs. If an invalid blurb is
+     * requested to be created, the stream will close with an error.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse> + sendBlurbs() { + return io.grpc.stub.ClientCalls.blockingClientStreamingCall( + getChannel(), getSendBlurbsMethod(), getCallOptions()); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse> + connect() { + return io.grpc.stub.ClientCalls.blockingBidiStreamingCall( + getChannel(), getConnectMethod(), getCallOptions()); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Messaging. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a room.
+     * 
+ */ + public com.google.showcase.v1beta1.Room createRoom( + com.google.showcase.v1beta1.CreateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the Room with the given resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.Room getRoom( + com.google.showcase.v1beta1.GetRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a room.
+     * 
+ */ + public com.google.showcase.v1beta1.Room updateRoom( + com.google.showcase.v1beta1.UpdateRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a room and all of its blurbs.
+     * 
+ */ + public com.google.protobuf.Empty deleteRoom( + com.google.showcase.v1beta1.DeleteRoomRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteRoomMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists all chat rooms.
+     * 
+ */ + public com.google.showcase.v1beta1.ListRoomsResponse listRooms( + com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListRoomsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb createBlurb( + com.google.showcase.v1beta1.CreateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves the Blurb with the given resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb getBlurb( + com.google.showcase.v1beta1.GetBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a blurb.
+     * 
+ */ + public com.google.showcase.v1beta1.Blurb updateBlurb( + com.google.showcase.v1beta1.UpdateBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a blurb.
+     * 
+ */ + public com.google.protobuf.Empty deleteBlurb( + com.google.showcase.v1beta1.DeleteBlurbRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteBlurbMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists blurbs for a specific chat room or user profile depending on the
+     * parent resource name.
+     * 
+ */ + public com.google.showcase.v1beta1.ListBlurbsResponse listBlurbs( + com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.longrunning.Operation searchBlurbs( + com.google.showcase.v1beta1.SearchBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchBlurbsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * This returns a stream that emits the blurbs that are created for a
+     * particular chat room or user profile.
+     * 
+ */ + public java.util.Iterator streamBlurbs( + com.google.showcase.v1beta1.StreamBlurbsRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getStreamBlurbsMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Messaging. + * + *
+   * 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.
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a room.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves the Room with the given resource name.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Updates a room.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Deletes a room and all of its blurbs.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists all chat rooms.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListRoomsResponse> + listRooms(com.google.showcase.v1beta1.ListRoomsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListRoomsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves the Blurb with the given resource name.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Updates a blurb.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Deletes a blurb.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists blurbs for a specific chat room or user profile depending on the
+     * parent resource name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListBlurbsResponse> + listBlurbs(com.google.showcase.v1beta1.ListBlurbsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListBlurbsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + 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>(service, METHODID_CREATE_ROOM))) + .addMethod( + getGetRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetRoomRequest, com.google.showcase.v1beta1.Room>( + service, METHODID_GET_ROOM))) + .addMethod( + getUpdateRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateRoomRequest, + com.google.showcase.v1beta1.Room>(service, METHODID_UPDATE_ROOM))) + .addMethod( + getDeleteRoomMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteRoomRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_ROOM))) + .addMethod( + getListRoomsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListRoomsRequest, + com.google.showcase.v1beta1.ListRoomsResponse>(service, METHODID_LIST_ROOMS))) + .addMethod( + getCreateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_CREATE_BLURB))) + .addMethod( + getGetBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetBlurbRequest, com.google.showcase.v1beta1.Blurb>( + service, METHODID_GET_BLURB))) + .addMethod( + getUpdateBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.UpdateBlurbRequest, + com.google.showcase.v1beta1.Blurb>(service, METHODID_UPDATE_BLURB))) + .addMethod( + getDeleteBlurbMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteBlurbRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_BLURB))) + .addMethod( + getListBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListBlurbsRequest, + com.google.showcase.v1beta1.ListBlurbsResponse>(service, METHODID_LIST_BLURBS))) + .addMethod( + getSearchBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.SearchBlurbsRequest, + com.google.longrunning.Operation>(service, METHODID_SEARCH_BLURBS))) + .addMethod( + getStreamBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.StreamBlurbsRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>( + service, METHODID_STREAM_BLURBS))) + .addMethod( + getSendBlurbsMethod(), + io.grpc.stub.ServerCalls.asyncClientStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateBlurbRequest, + com.google.showcase.v1beta1.SendBlurbsResponse>(service, METHODID_SEND_BLURBS))) + .addMethod( + getConnectMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.ConnectRequest, + com.google.showcase.v1beta1.StreamBlurbsResponse>(service, METHODID_CONNECT))) + .build(); + } + + private abstract static 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 java.lang.String methodName; + + MessagingMethodDescriptorSupplier(java.lang.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/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java new file mode 100644 index 0000000000..7172cf958f --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -0,0 +1,1045 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** */ +@io.grpc.stub.annotations.GrpcGenerated +public final class SequenceServiceGrpc { + + private SequenceServiceGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.SequenceService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + 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< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + getCreateSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSequenceRequest, com.google.showcase.v1beta1.Sequence> + 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< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateStreamingSequence", + requestType = com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequence.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence> + getCreateStreamingSequenceMethod; + if ((getCreateStreamingSequenceMethod = SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getCreateStreamingSequenceMethod = + SequenceServiceGrpc.getCreateStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getCreateStreamingSequenceMethod = + getCreateStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "CreateStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("CreateStreamingSequence")) + .build(); + } + } + } + return getCreateStreamingSequenceMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + 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< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + getGetSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport> + 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< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetStreamingSequenceReport", + requestType = com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + responseType = com.google.showcase.v1beta1.StreamingSequenceReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport> + getGetStreamingSequenceReportMethod; + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getGetStreamingSequenceReportMethod = + SequenceServiceGrpc.getGetStreamingSequenceReportMethod) + == null) { + SequenceServiceGrpc.getGetStreamingSequenceReportMethod = + getGetStreamingSequenceReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetStreamingSequenceReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.StreamingSequenceReport + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("GetStreamingSequenceReport")) + .build(); + } + } + } + return getGetStreamingSequenceReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + getAttemptSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty> + 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; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "AttemptStreamingSequence", + requestType = com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + responseType = com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + getAttemptStreamingSequenceMethod; + if ((getAttemptStreamingSequenceMethod = SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + synchronized (SequenceServiceGrpc.class) { + if ((getAttemptStreamingSequenceMethod = + SequenceServiceGrpc.getAttemptStreamingSequenceMethod) + == null) { + SequenceServiceGrpc.getAttemptStreamingSequenceMethod = + getAttemptStreamingSequenceMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "AttemptStreamingSequence")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new SequenceServiceMethodDescriptorSupplier("AttemptStreamingSequence")) + .build(); + } + } + } + return getAttemptStreamingSequenceMethod; + } + + /** 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 all types of calls on the service */ + public static SequenceServiceBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public SequenceServiceBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + }; + return SequenceServiceBlockingV2Stub.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 interface AsyncService { + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + default void createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSequenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + default void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateStreamingSequenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + default void getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + default void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetStreamingSequenceReportMethod(), responseObserver); + } + + /** + * + * + *
+     * Attempts a sequence.
+     * 
+ */ + default void attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptSequenceMethod(), responseObserver); + } + + /** + * + * + *
+     * Attempts a streaming sequence.
+     * May not function as expected in HTTP mode due to when http statuses are sent
+     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
+     * 
+ */ + default void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getAttemptStreamingSequenceMethod(), responseObserver); + } + } + + /** Base class for the server implementation of the service SequenceService. */ + public abstract static class SequenceServiceImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return SequenceServiceGrpc.bindService(this); + } + } + + /** A stub to allow clients to do asynchronous rpc calls to service SequenceService. */ + 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); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + public void createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public void getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Attempts a sequence.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Attempts a streaming sequence.
+     * May not function as expected in HTTP mode due to when http statuses are sent
+     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
+     * 
+ */ + public void attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getAttemptStreamingSequenceMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** A stub to allow clients to do synchronous rpc calls to service SequenceService. */ + public static final class SequenceServiceBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private SequenceServiceBlockingV2Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected SequenceServiceBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new SequenceServiceBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) + throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Attempts a sequence.
+     * 
+ */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Attempts a streaming sequence.
+     * May not function as expected in HTTP mode due to when http statuses are sent
+     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
+     * 
+ */ + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/10918") + public io.grpc.stub.BlockingClientCall< + ?, com.google.showcase.v1beta1.AttemptStreamingSequenceResponse> + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingV2ServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do limited synchronous rpc calls to service SequenceService. */ + 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); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.Sequence createSequence( + com.google.showcase.v1beta1.CreateSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.StreamingSequence createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateStreamingSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.SequenceReport getSequenceReport( + com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.showcase.v1beta1.StreamingSequenceReport getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetStreamingSequenceReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Attempts a sequence.
+     * 
+ */ + public com.google.protobuf.Empty attemptSequence( + com.google.showcase.v1beta1.AttemptSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getAttemptSequenceMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Attempts a streaming sequence.
+     * May not function as expected in HTTP mode due to when http statuses are sent
+     * See https://github.com/googleapis/gapic-showcase/issues/1377 for more details
+     * 
+ */ + public java.util.Iterator + attemptStreamingSequence( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getAttemptStreamingSequenceMethod(), getCallOptions(), request); + } + } + + /** A stub to allow clients to do ListenableFuture-style rpc calls to service SequenceService. */ + 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); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a sequence.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequence> + createStreamingSequence( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateStreamingSequenceMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.SequenceReport> + getSequenceReport(com.google.showcase.v1beta1.GetSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Retrieves a sequence.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.StreamingSequenceReport> + getStreamingSequenceReport( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetStreamingSequenceReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Attempts a sequence.
+     * 
+ */ + 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_CREATE_STREAMING_SEQUENCE = 1; + private static final int METHODID_GET_SEQUENCE_REPORT = 2; + private static final int METHODID_GET_STREAMING_SEQUENCE_REPORT = 3; + private static final int METHODID_ATTEMPT_SEQUENCE = 4; + private static final int METHODID_ATTEMPT_STREAMING_SEQUENCE = 5; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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_CREATE_STREAMING_SEQUENCE: + serviceImpl.createStreamingSequence( + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) 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_GET_STREAMING_SEQUENCE_REPORT: + serviceImpl.getStreamingSequenceReport( + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) 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; + case METHODID_ATTEMPT_STREAMING_SEQUENCE: + serviceImpl.attemptStreamingSequence( + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) request, + (io.grpc.stub.StreamObserver< + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>) + 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + 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>(service, METHODID_CREATE_SEQUENCE))) + .addMethod( + getCreateStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CreateStreamingSequenceRequest, + com.google.showcase.v1beta1.StreamingSequence>( + service, METHODID_CREATE_STREAMING_SEQUENCE))) + .addMethod( + getGetSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSequenceReportRequest, + com.google.showcase.v1beta1.SequenceReport>( + service, METHODID_GET_SEQUENCE_REPORT))) + .addMethod( + getGetStreamingSequenceReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest, + com.google.showcase.v1beta1.StreamingSequenceReport>( + service, METHODID_GET_STREAMING_SEQUENCE_REPORT))) + .addMethod( + getAttemptSequenceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptSequenceRequest, com.google.protobuf.Empty>( + service, METHODID_ATTEMPT_SEQUENCE))) + .addMethod( + getAttemptStreamingSequenceMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse>( + service, METHODID_ATTEMPT_STREAMING_SEQUENCE))) + .build(); + } + + private abstract static 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 java.lang.String methodName; + + SequenceServiceMethodDescriptorSupplier(java.lang.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(getCreateStreamingSequenceMethod()) + .addMethod(getGetSequenceReportMethod()) + .addMethod(getGetStreamingSequenceReportMethod()) + .addMethod(getAttemptSequenceMethod()) + .addMethod(getAttemptStreamingSequenceMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java new file mode 100644 index 0000000000..36f60a584b --- /dev/null +++ b/java-showcase-3.21.0/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingGrpc.java @@ -0,0 +1,1363 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * A service to facilitate running discrete sets of tests
+ * against Showcase.
+ * Adding this comment with special characters for comment formatting tests:
+ * 1. (abra->kadabra->alakazam)
+ * 2) [Nonsense][]: `pokemon/*/psychic/*`
+ * 
+ */ +@io.grpc.stub.annotations.GrpcGenerated +public final class TestingGrpc { + + private TestingGrpc() {} + + public static final java.lang.String SERVICE_NAME = "google.showcase.v1beta1.Testing"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + 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< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + getCreateSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CreateSessionRequest, com.google.showcase.v1beta1.Session> + 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< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + 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< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + getGetSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.GetSessionRequest, com.google.showcase.v1beta1.Session> + 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< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + 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< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + getListSessionsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse> + 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< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + getDeleteSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + 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< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + getReportSessionMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse> + 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< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + 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< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + getListTestsMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse> + 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< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + getDeleteTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty> + 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< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + 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< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + getVerifyTestMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse> + 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 all types of calls on the service */ + public static TestingBlockingV2Stub newBlockingV2Stub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public TestingBlockingV2Stub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + }; + return TestingBlockingV2Stub.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); + } + + /** + * + * + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Creates a new testing session.
+     * Adding this comment with special characters for comment formatting tests:
+     * 1. (abra->kadabra->alakazam)
+     * 2) [Nonsense][]: `pokemon/*/psychic/*`
+     * 
+ */ + default void createSession( + com.google.showcase.v1beta1.CreateSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a testing session.
+     * 
+ */ + default void getSession( + com.google.showcase.v1beta1.GetSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists the current test sessions.
+     * 
+ */ + default void listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListSessionsMethod(), responseObserver); + } + + /** + * + * + *
+     * Delete a test session.
+     * 
+ */ + default void deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * Report on the status of a session.
+     * This generates a report detailing which tests have been completed,
+     * and an overall rollup.
+     * 
+ */ + default void reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getReportSessionMethod(), responseObserver); + } + + /** + * + * + *
+     * List the tests of a sessesion.
+     * 
+ */ + default void listTests( + com.google.showcase.v1beta1.ListTestsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTestsMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteTestMethod(), responseObserver); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + default void verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyTestMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service Testing. + * + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ + public abstract static class TestingImplBase implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return TestingGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service Testing. + * + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a new testing session.
+     * Adding this comment with special characters for comment formatting tests:
+     * 1. (abra->kadabra->alakazam)
+     * 2) [Nonsense][]: `pokemon/*/psychic/*`
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Gets a testing session.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists the current test sessions.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Delete a test session.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Report on the status of a session.
+     * This generates a report detailing which tests have been completed,
+     * and an overall rollup.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * List the tests of a sessesion.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service Testing. + * + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ + public static final class TestingBlockingV2Stub + extends io.grpc.stub.AbstractBlockingStub { + private TestingBlockingV2Stub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected TestingBlockingV2Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new TestingBlockingV2Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new testing session.
+     * Adding this comment with special characters for comment formatting tests:
+     * 1. (abra->kadabra->alakazam)
+     * 2) [Nonsense][]: `pokemon/*/psychic/*`
+     * 
+ */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a testing session.
+     * 
+ */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the current test sessions.
+     * 
+ */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a test session.
+     * 
+ */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Report on the status of a session.
+     * This generates a report detailing which tests have been completed,
+     * and an overall rollup.
+     * 
+ */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List the tests of a sessesion.
+     * 
+ */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do limited synchronous rpc calls to service Testing. + * + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a new testing session.
+     * Adding this comment with special characters for comment formatting tests:
+     * 1. (abra->kadabra->alakazam)
+     * 2) [Nonsense][]: `pokemon/*/psychic/*`
+     * 
+ */ + public com.google.showcase.v1beta1.Session createSession( + com.google.showcase.v1beta1.CreateSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a testing session.
+     * 
+ */ + public com.google.showcase.v1beta1.Session getSession( + com.google.showcase.v1beta1.GetSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists the current test sessions.
+     * 
+ */ + public com.google.showcase.v1beta1.ListSessionsResponse listSessions( + com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListSessionsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Delete a test session.
+     * 
+ */ + public com.google.protobuf.Empty deleteSession( + com.google.showcase.v1beta1.DeleteSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Report on the status of a session.
+     * This generates a report detailing which tests have been completed,
+     * and an overall rollup.
+     * 
+ */ + public com.google.showcase.v1beta1.ReportSessionResponse reportSession( + com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getReportSessionMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List the tests of a sessesion.
+     * 
+ */ + public com.google.showcase.v1beta1.ListTestsResponse listTests( + com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListTestsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.protobuf.Empty deleteTest( + com.google.showcase.v1beta1.DeleteTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteTestMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.showcase.v1beta1.VerifyTestResponse verifyTest( + com.google.showcase.v1beta1.VerifyTestRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getVerifyTestMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service Testing. + * + *
+   * A service to facilitate running discrete sets of tests
+   * against Showcase.
+   * Adding this comment with special characters for comment formatting tests:
+   * 1. (abra->kadabra->alakazam)
+   * 2) [Nonsense][]: `pokemon/*/psychic/*`
+   * 
+ */ + 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); + } + + /** + * + * + *
+     * Creates a new testing session.
+     * Adding this comment with special characters for comment formatting tests:
+     * 1. (abra->kadabra->alakazam)
+     * 2) [Nonsense][]: `pokemon/*/psychic/*`
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Gets a testing session.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Lists the current test sessions.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListSessionsResponse> + listSessions(com.google.showcase.v1beta1.ListSessionsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListSessionsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Delete a test session.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * Report on the status of a session.
+     * This generates a report detailing which tests have been completed,
+     * and an overall rollup.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ReportSessionResponse> + reportSession(com.google.showcase.v1beta1.ReportSessionRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getReportSessionMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List the tests of a sessesion.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.ListTestsResponse> + listTests(com.google.showcase.v1beta1.ListTestsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListTestsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + 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); + } + + /** + * + * + *
+     * 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.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.VerifyTestResponse> + 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 AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + 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>(service, METHODID_CREATE_SESSION))) + .addMethod( + getGetSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.GetSessionRequest, + com.google.showcase.v1beta1.Session>(service, METHODID_GET_SESSION))) + .addMethod( + getListSessionsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListSessionsRequest, + com.google.showcase.v1beta1.ListSessionsResponse>( + service, METHODID_LIST_SESSIONS))) + .addMethod( + getDeleteSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteSessionRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_SESSION))) + .addMethod( + getReportSessionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ReportSessionRequest, + com.google.showcase.v1beta1.ReportSessionResponse>( + service, METHODID_REPORT_SESSION))) + .addMethod( + getListTestsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.ListTestsRequest, + com.google.showcase.v1beta1.ListTestsResponse>(service, METHODID_LIST_TESTS))) + .addMethod( + getDeleteTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.DeleteTestRequest, com.google.protobuf.Empty>( + service, METHODID_DELETE_TEST))) + .addMethod( + getVerifyTestMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.VerifyTestRequest, + com.google.showcase.v1beta1.VerifyTestResponse>(service, METHODID_VERIFY_TEST))) + .build(); + } + + private abstract static 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 java.lang.String methodName; + + TestingMethodDescriptorSupplier(java.lang.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/java-showcase-3.21.0/pom.xml b/java-showcase-3.21.0/pom.xml new file mode 100644 index 0000000000..c8b4143143 --- /dev/null +++ b/java-showcase-3.21.0/pom.xml @@ -0,0 +1,259 @@ + + + 4.0.0 + com.google.cloud + gapic-showcase-parent + pom + 0.0.1-SNAPSHOT + GAPIC Showcase Client Core Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-shared-config + 1.17.0 + + + + + UTF-8 + UTF-8 + github + google-cloud-showcase-parent + true + true + true + + + + + + com.google.cloud + google-cloud-shared-dependencies + 3.54.2-SNAPSHOT + pom + import + + + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.cloud + gapic-showcase + 0.0.1-SNAPSHOT + + + org.junit + junit-bom + 5.11.4 + pom + import + + + + + + gapic-showcase + grpc-gapic-showcase-v1beta1 + proto-gapic-showcase-v1beta1 + + + + + native + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.graalvm.buildtools + native-maven-plugin + true + + + test-native + + test + + test + + + + + --no-fallback + --no-server + --verbose + + + + + + + + showcase + + true + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + + loggingTestBase + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.2 + + sponge_log + ${skipUnitTests} + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + + + org.apache.maven.surefire + surefire-junit-platform + ${surefire.version} + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + + + enable-golden-tests + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + **/com/google/showcase/v1beta1/it/logging/*.java + + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + test + + bash + + scripts/verify.sh + + + + + + + + + + update + + + + org.codehaus.mojo + exec-maven-plugin + 3.5.0 + false + + + verify-showcase + + exec + + generate-sources + + bash + + scripts/generate_showcase.sh + --replace + true + + + + + + + + + + diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/pom.xml b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/pom.xml new file mode 100644 index 0000000000..cef41f54ff --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/pom.xml @@ -0,0 +1,57 @@ + + 4.0.0 + com.google.api.grpc + proto-gapic-showcase-v1beta1 + 0.0.1-SNAPSHOT + proto-gapic-showcase-v1beta1 + PROTO library for proto-gapic-showcase-v1beta1 + + com.google.cloud + gapic-showcase-parent + 0.0.1-SNAPSHOT + + + + true + + + + + 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 + + + + + + + showcase-sonar-analysis + + + enableShowcaseTestCoverage + + + + true + + + + diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java new file mode 100644 index 0000000000..7f7e53ed8c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequest.java @@ -0,0 +1,603 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..bbe1dcfbdb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptSequenceRequestOrBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java new file mode 100644 index 0000000000..1bdd243c27 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequest.java @@ -0,0 +1,707 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceRequest} */ +public final class AttemptStreamingSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + AttemptStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptStreamingSequenceRequest.newBuilder() to construct. + private AttemptStreamingSequenceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptStreamingSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttemptStreamingSequenceRequest( + 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: + { + lastFailIndex_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.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; + } + } + + public static final int LAST_FAIL_INDEX_FIELD_NUMBER = 2; + private int lastFailIndex_; + + /** + * + * + *
+   * used to send the index of the last failed message
+   * in the string "content" of an AttemptStreamingSequenceResponse
+   * needed for stream resumption logic testing
+   * 
+ * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + 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 (lastFailIndex_ != 0) { + output.writeInt32(2, lastFailIndex_); + } + 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 (lastFailIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, lastFailIndex_); + } + 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.AttemptStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (getLastFailIndex() != other.getLastFailIndex()) 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) + LAST_FAIL_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getLastFailIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.AttemptStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.AttemptStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.AttemptStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest 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.AttemptStreamingSequenceRequest 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.AttemptStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + com.google.showcase.v1beta1.AttemptStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.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_ = ""; + + lastFailIndex_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceRequest result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(this); + result.name_ = name_; + result.lastFailIndex_ = lastFailIndex_; + 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.AttemptStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.AttemptStreamingSequenceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getLastFailIndex() != 0) { + setLastFailIndex(other.getLastFailIndex()); + } + 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.AttemptStreamingSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.AttemptStreamingSequenceRequest) 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; + } + + private int lastFailIndex_; + + /** + * + * + *
+     * used to send the index of the last failed message
+     * in the string "content" of an AttemptStreamingSequenceResponse
+     * needed for stream resumption logic testing
+     * 
+ * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + @java.lang.Override + public int getLastFailIndex() { + return lastFailIndex_; + } + + /** + * + * + *
+     * used to send the index of the last failed message
+     * in the string "content" of an AttemptStreamingSequenceResponse
+     * needed for stream resumption logic testing
+     * 
+ * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The lastFailIndex to set. + * @return This builder for chaining. + */ + public Builder setLastFailIndex(int value) { + + lastFailIndex_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * used to send the index of the last failed message
+     * in the string "content" of an AttemptStreamingSequenceResponse
+     * needed for stream resumption logic testing
+     * 
+ * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearLastFailIndex() { + + lastFailIndex_ = 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.AttemptStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttemptStreamingSequenceRequest(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.AttemptStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..4e6cda9daf --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface AttemptStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceRequest) + 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(); + + /** + * + * + *
+   * used to send the index of the last failed message
+   * in the string "content" of an AttemptStreamingSequenceResponse
+   * needed for stream resumption logic testing
+   * 
+ * + * int32 last_fail_index = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The lastFailIndex. + */ + int getLastFailIndex(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java new file mode 100644 index 0000000000..959c9eb5f7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponse.java @@ -0,0 +1,652 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * The response message for the Echo methods.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.AttemptStreamingSequenceResponse} + */ +public final class AttemptStreamingSequenceResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + AttemptStreamingSequenceResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AttemptStreamingSequenceResponse.newBuilder() to construct. + private AttemptStreamingSequenceResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AttemptStreamingSequenceResponse() { + content_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AttemptStreamingSequenceResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AttemptStreamingSequenceResponse( + 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.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.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; + } + } + + 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.AttemptStreamingSequenceResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other = + (com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) 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.AttemptStreamingSequenceResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.AttemptStreamingSequenceResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.AttemptStreamingSequenceResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.AttemptStreamingSequenceResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse 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.AttemptStreamingSequenceResponse 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.AttemptStreamingSequenceResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + com.google.showcase.v1beta1.AttemptStreamingSequenceResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.class, + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.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.SequenceOuterClass + .internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse build() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.AttemptStreamingSequenceResponse buildPartial() { + com.google.showcase.v1beta1.AttemptStreamingSequenceResponse result = + new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(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.AttemptStreamingSequenceResponse) { + return mergeFrom((com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.AttemptStreamingSequenceResponse other) { + if (other + == com.google.showcase.v1beta1.AttemptStreamingSequenceResponse.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.AttemptStreamingSequenceResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.AttemptStreamingSequenceResponse) 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; + } + + @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.AttemptStreamingSequenceResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + private static final com.google.showcase.v1beta1.AttemptStreamingSequenceResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.AttemptStreamingSequenceResponse(); + } + + public static com.google.showcase.v1beta1.AttemptStreamingSequenceResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AttemptStreamingSequenceResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AttemptStreamingSequenceResponse(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.AttemptStreamingSequenceResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java new file mode 100644 index 0000000000..b8ca583828 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/AttemptStreamingSequenceResponseOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface AttemptStreamingSequenceResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.AttemptStreamingSequenceResponse) + 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(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java new file mode 100644 index 0000000000..eac6e1a2c7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequest.java @@ -0,0 +1,1457 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java new file mode 100644 index 0000000000..6c60854c42 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockRequestOrBuilder.java @@ -0,0 +1,141 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java new file mode 100644 index 0000000000..61e898ce4a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponse.java @@ -0,0 +1,652 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java new file mode 100644 index 0000000000..ca73f88030 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlockResponseOrBuilder.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java new file mode 100644 index 0000000000..000967a381 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Blurb.java @@ -0,0 +1,2517 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java new file mode 100644 index 0000000000..cd7fed2a8a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbName.java @@ -0,0 +1,458 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.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(); + } + + public static Builder newUserLegacyUserBlurbBuilder() { + return new Builder(); + } + + public static UserBlurbBuilder newUserBlurbBuilder() { + return new UserBlurbBuilder(); + } + + public static RoomBlurbBuilder newRoomBlurbBuilder() { + return new RoomBlurbBuilder(); + } + + 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(); + } + + public static BlurbName ofUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build(); + } + + public static BlurbName ofUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build(); + } + + public static BlurbName ofRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build(); + } + + 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(); + } + + public static String formatUserLegacyUserBlurbName(String user, String legacyUser, String blurb) { + return newBuilder().setUser(user).setLegacyUser(legacyUser).setBlurb(blurb).build().toString(); + } + + public static String formatUserBlurbName(String user, String blurb) { + return newUserBlurbBuilder().setUser(user).setBlurb(blurb).build().toString(); + } + + public static String formatRoomBlurbName(String room, String blurb) { + return newRoomBlurbBuilder().setRoom(room).setBlurb(blurb).build().toString(); + } + + 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}. */ + 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}. */ + 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}. */ + 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java new file mode 100644 index 0000000000..6d1bbf363a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/BlurbOrBuilder.java @@ -0,0 +1,320 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java new file mode 100644 index 0000000000..ad646647b2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java @@ -0,0 +1,2887 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java new file mode 100644 index 0000000000..8add33da44 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChild.java @@ -0,0 +1,1929 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java new file mode 100644 index 0000000000..d388a3776e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataChildOrBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java new file mode 100644 index 0000000000..4882baa2d7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchild.java @@ -0,0 +1,733 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java new file mode 100644 index 0000000000..e37e4e9f13 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataGrandchildOrBuilder.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java new file mode 100644 index 0000000000..4b0b34b205 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java @@ -0,0 +1,269 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java new file mode 100644 index 0000000000..7cd8869afd --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroup.java @@ -0,0 +1,1148 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java new file mode 100644 index 0000000000..0053920088 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGroupOrBuilder.java @@ -0,0 +1,85 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java new file mode 100644 index 0000000000..2dd24e23f7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java @@ -0,0 +1,370 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/client.proto\"\303\002\n\r" + + "RepeatRequest\022\014\n" + + "\004name\030\001 \001(\t\0225\n" + + "\004info\030\002 \001(\0132\'.google.showcase.v1beta1.ComplianceData\022\025\n\r" + + "server_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_intended_binding_uriB\n\n" + + "\010_p_int32B\n\n" + + "\010_p_int64B\013\n" + + "\t_p_double\"^\n" + + "\016RepeatResponse\0227\n" + + "\007request\030\001 \001(\0132&.google.showcase.v1beta1.RepeatRequest\022\023\n" + + "\013binding_uri\030\002 \001(\t\"J\n" + + "\017ComplianceSuite\0227\n" + + "\005group\030\001 \003(\0132(.google.showcase.v1beta1.ComplianceGroup\"g\n" + + "\017ComplianceGroup\022\014\n" + + "\004name\030\001 \001(\t\022\014\n" + + "\004rpcs\030\002 \003(\t\0228\n" + + "\010requests\030\003 \003(\0132&.google.showcase.v1beta1.RepeatRequest\"\340\006\n" + + "\016ComplianceData\022\020\n" + + "\010f_string\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\n" + + "f_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\n" + + "f_sfixed64\030\t \001(\020\022\020\n" + + "\010f_uint64\030\n" + + " \001(\004\022\021\n" + + "\tf_fixed64\030\013 \001(\006\022\020\n" + + "\010f_double\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.ComplianceData.LifeKingdom\022=\n" + + "\007f_child\030\020 \001(\0132,.google.showcase.v1beta1.ComplianceDataChild\022\025\n" + + "\010p_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(\010H\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.v1beta1.ComplianceDataChildH\005\210\001\001\"\203\001\n" + + "\013LifeKingdom\022\034\n" + + "\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n" + + "\016ARCHAEBACTERIA\020\001\022\016\n\n" + + "EUBACTERIA\020\002\022\014\n" + + "\010PROTISTA\020\003\022\t\n" + + "\005FUNGI\020\004\022\013\n" + + "\007PLANTAE\020\005\022\014\n" + + "\010ANIMALIA\020\006B\013\n" + + "\t_p_stringB\n\n" + + "\010_p_int32B\013\n" + + "\t_p_doubleB\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" + + "\006f_bool\030\004 \001(\010\0227\n" + + "\013f_continent\030\013 \001(\0162\".google.showcase.v1beta1.Continent\022B\n" + + "\007f_child\030\005" + + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchild\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(\001H\002\210\001\001\022\023\n" + + "\006p_bool\030\t \001(\010H\003\210\001\001\0227\n" + + "\013p_continent\030\014 \001(\0162\".google.showcase.v1beta1.Continent\022G\n" + + "\007p_child\030\n" + + " \001(\01321.google.showcase.v1beta1.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" + + "\030ComplianceDataGrandchild\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" + + "\014unknown_enum\030\001 \001(\010\"|\n" + + "\014EnumResponse\0225\n" + + "\007request\030\001 \001(\0132$.google.showcase.v1beta1.EnumRequest\0225\n" + + "\tcontinent\030\002 \001(\0162\".google.showcase.v1beta1.Continent*i\n" + + "\tContinent\022\031\n" + + "\025CONTINENT_UNSPECIFIED\020\000\022\n\n" + + "\006AFRICA\020\001\022\013\n" + + "\007AMERICA\020\002\022\r\n" + + "\tANTARTICA\020\003\022\r\n" + + "\tAUSTRALIA\020\004\022\n\n" + + "\006EUROPE\020\0052\330\r\n\n" + + "Compliance\022\202\001\n" + + "\016RepeatDataBody\022&.google.showcase.v1beta1.RepeatReques" + + "t\032\'.google.showcase.v1beta1.RepeatResponse\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n" + + "\022RepeatDataBodyInfo\022&.google.showcase.v1b" + + "eta1.RepeatRequest\032\'.google.showcase.v1beta1.RepeatResponse\"&\202\323\344\223\002" + + " \"\030/v1beta1/repeat: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" + + "\024RepeatDataSimplePath\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/{info.f_bool}:childfirstpathresource\022\331\001\n" + + "\036RepeatDataPathTrailingResource\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/**}:pathtrailingresource\022\210\001\n" + + "\021RepeatDataBodyPut\022&.google.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" + + "\023RepeatDataBodyPatch\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repeat:bodypatch:\001*\022x\n" + + "\007GetEnum\022$.google.show" + + "case.v1beta1.EnumRequest\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\022\030/v1beta1/compliance/enum\022|\n\n" + + "VerifyEnum\022%.google" + + ".showcase.v1beta1.EnumResponse\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\"\030/" + + "v1beta1/compliance/enum\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/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(), + }); + 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java new file mode 100644 index 0000000000..e812510224 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuite.java @@ -0,0 +1,793 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java new file mode 100644 index 0000000000..0d0ead0677 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceSuiteOrBuilder.java @@ -0,0 +1,41 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java new file mode 100644 index 0000000000..8f00f61855 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequest.java @@ -0,0 +1,1835 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java new file mode 100644 index 0000000000..62f0110274 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ConnectRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java new file mode 100644 index 0000000000..3e3b35a327 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Continent.java @@ -0,0 +1,143 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java new file mode 100644 index 0000000000..468650424e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequest.java @@ -0,0 +1,948 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..10a4eb4e42 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateBlurbRequestOrBuilder.java @@ -0,0 +1,94 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java new file mode 100644 index 0000000000..0c9f48e9f2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequest.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..70ac5ce00f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateRoomRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java new file mode 100644 index 0000000000..c43a97e737 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..93b0341821 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSequenceRequestOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java new file mode 100644 index 0000000000..aee834a67e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequest.java @@ -0,0 +1,770 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java new file mode 100644 index 0000000000..e1b21c09f4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateSessionRequestOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java new file mode 100644 index 0000000000..74997f3ed8 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequest.java @@ -0,0 +1,648 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CreateStreamingSequenceRequest} */ +public final class CreateStreamingSequenceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + CreateStreamingSequenceRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use CreateStreamingSequenceRequest.newBuilder() to construct. + private CreateStreamingSequenceRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateStreamingSequenceRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateStreamingSequenceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateStreamingSequenceRequest( + 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.StreamingSequence.Builder subBuilder = null; + if (streamingSequence_ != null) { + subBuilder = streamingSequence_.toBuilder(); + } + streamingSequence_ = + input.readMessage( + com.google.showcase.v1beta1.StreamingSequence.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(streamingSequence_); + streamingSequence_ = 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_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + public static final int STREAMING_SEQUENCE_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + @java.lang.Override + public boolean hasStreamingSequence() { + return streamingSequence_ != null; + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + return getStreamingSequence(); + } + + 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 (streamingSequence_ != null) { + output.writeMessage(1, getStreamingSequence()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (streamingSequence_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getStreamingSequence()); + } + 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.CreateStreamingSequenceRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CreateStreamingSequenceRequest other = + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) obj; + + if (hasStreamingSequence() != other.hasStreamingSequence()) return false; + if (hasStreamingSequence()) { + if (!getStreamingSequence().equals(other.getStreamingSequence())) 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 (hasStreamingSequence()) { + hash = (37 * hash) + STREAMING_SEQUENCE_FIELD_NUMBER; + hash = (53 * hash) + getStreamingSequence().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.CreateStreamingSequenceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.CreateStreamingSequenceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.CreateStreamingSequenceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest 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.CreateStreamingSequenceRequest 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.CreateStreamingSequenceRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.showcase.v1beta1.CreateStreamingSequenceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.class, + com.google.showcase.v1beta1.CreateStreamingSequenceRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CreateStreamingSequenceRequest.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 (streamingSequenceBuilder_ == null) { + streamingSequence_ = null; + } else { + streamingSequence_ = null; + streamingSequenceBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest build() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CreateStreamingSequenceRequest buildPartial() { + com.google.showcase.v1beta1.CreateStreamingSequenceRequest result = + new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(this); + if (streamingSequenceBuilder_ == null) { + result.streamingSequence_ = streamingSequence_; + } else { + result.streamingSequence_ = streamingSequenceBuilder_.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.CreateStreamingSequenceRequest) { + return mergeFrom((com.google.showcase.v1beta1.CreateStreamingSequenceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CreateStreamingSequenceRequest other) { + if (other == com.google.showcase.v1beta1.CreateStreamingSequenceRequest.getDefaultInstance()) + return this; + if (other.hasStreamingSequence()) { + mergeStreamingSequence(other.getStreamingSequence()); + } + 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.CreateStreamingSequenceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.CreateStreamingSequenceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.StreamingSequence streamingSequence_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + streamingSequenceBuilder_; + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + public boolean hasStreamingSequence() { + return streamingSequenceBuilder_ != null || streamingSequence_ != null; + } + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + public com.google.showcase.v1beta1.StreamingSequence getStreamingSequence() { + if (streamingSequenceBuilder_ == null) { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } else { + return streamingSequenceBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamingSequence_ = value; + onChanged(); + } else { + streamingSequenceBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder setStreamingSequence( + com.google.showcase.v1beta1.StreamingSequence.Builder builderForValue) { + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = builderForValue.build(); + onChanged(); + } else { + streamingSequenceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder mergeStreamingSequence(com.google.showcase.v1beta1.StreamingSequence value) { + if (streamingSequenceBuilder_ == null) { + if (streamingSequence_ != null) { + streamingSequence_ = + com.google.showcase.v1beta1.StreamingSequence.newBuilder(streamingSequence_) + .mergeFrom(value) + .buildPartial(); + } else { + streamingSequence_ = value; + } + onChanged(); + } else { + streamingSequenceBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public Builder clearStreamingSequence() { + if (streamingSequenceBuilder_ == null) { + streamingSequence_ = null; + onChanged(); + } else { + streamingSequence_ = null; + streamingSequenceBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequence.Builder getStreamingSequenceBuilder() { + + onChanged(); + return getStreamingSequenceFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + public com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder() { + if (streamingSequenceBuilder_ != null) { + return streamingSequenceBuilder_.getMessageOrBuilder(); + } else { + return streamingSequence_ == null + ? com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance() + : streamingSequence_; + } + } + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder> + getStreamingSequenceFieldBuilder() { + if (streamingSequenceBuilder_ == null) { + streamingSequenceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence, + com.google.showcase.v1beta1.StreamingSequence.Builder, + com.google.showcase.v1beta1.StreamingSequenceOrBuilder>( + getStreamingSequence(), getParentForChildren(), isClean()); + streamingSequence_ = null; + } + return streamingSequenceBuilder_; + } + + @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.CreateStreamingSequenceRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CreateStreamingSequenceRequest) + private static final com.google.showcase.v1beta1.CreateStreamingSequenceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CreateStreamingSequenceRequest(); + } + + public static com.google.showcase.v1beta1.CreateStreamingSequenceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateStreamingSequenceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateStreamingSequenceRequest(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.CreateStreamingSequenceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java new file mode 100644 index 0000000000..6540c0105f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateStreamingSequenceRequestOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface CreateStreamingSequenceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CreateStreamingSequenceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return Whether the streamingSequence field is set. + */ + boolean hasStreamingSequence(); + + /** + * .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; + * + * @return The streamingSequence. + */ + com.google.showcase.v1beta1.StreamingSequence getStreamingSequence(); + + /** .google.showcase.v1beta1.StreamingSequence streaming_sequence = 1; */ + com.google.showcase.v1beta1.StreamingSequenceOrBuilder getStreamingSequenceOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java new file mode 100644 index 0000000000..a6cade3e11 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequest.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java new file mode 100644 index 0000000000..d33fee565d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CreateUserRequestOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java new file mode 100644 index 0000000000..8ea6535496 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..6a512694ee --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteBlurbRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java new file mode 100644 index 0000000000..fdc7728a40 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java new file mode 100644 index 0000000000..28767d0d0b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteRoomRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java new file mode 100644 index 0000000000..28372c3544 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java new file mode 100644 index 0000000000..c64c0e3f26 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteSessionRequestOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java new file mode 100644 index 0000000000..fc7e9645f7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java new file mode 100644 index 0000000000..f40d9e8ae2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteTestRequestOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java new file mode 100644 index 0000000000..a150ee2378 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java new file mode 100644 index 0000000000..ec8973af2f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/DeleteUserRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java new file mode 100644 index 0000000000..54b686e83c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequest.java @@ -0,0 +1,960 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * The request message used for the EchoErrorDetails method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ +public final class EchoErrorDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + EchoErrorDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoErrorDetailsRequest.newBuilder() to construct. + private EchoErrorDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoErrorDetailsRequest() { + singleDetailText_ = ""; + multiDetailText_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoErrorDetailsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EchoErrorDetailsRequest( + 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(); + + singleDetailText_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + multiDetailText_.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)) { + multiDetailText_ = multiDetailText_.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_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + public static final int SINGLE_DETAIL_TEXT_FIELD_NUMBER = 1; + private volatile java.lang.Object singleDetailText_; + + /** + * + * + *
+   * Content to return in a singular `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + @java.lang.Override + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + 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(); + singleDetailText_ = s; + return s; + } + } + + /** + * + * + *
+   * Content to return in a singular `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MULTI_DETAIL_TEXT_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList multiDetailText_; + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + return multiDetailText_; + } + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.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 { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(singleDetailText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, singleDetailText_); + } + for (int i = 0; i < multiDetailText_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, multiDetailText_.getRaw(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(singleDetailText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, singleDetailText_); + } + { + int dataSize = 0; + for (int i = 0; i < multiDetailText_.size(); i++) { + dataSize += computeStringSizeNoTag(multiDetailText_.getRaw(i)); + } + size += dataSize; + size += 1 * getMultiDetailTextList().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.EchoErrorDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsRequest other = + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) obj; + + if (!getSingleDetailText().equals(other.getSingleDetailText())) return false; + if (!getMultiDetailTextList().equals(other.getMultiDetailTextList())) 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) + SINGLE_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetailText().hashCode(); + if (getMultiDetailTextCount() > 0) { + hash = (37 * hash) + MULTI_DETAIL_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getMultiDetailTextList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.EchoErrorDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.EchoErrorDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.EchoErrorDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest 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.EchoErrorDetailsRequest 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 EchoErrorDetails method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.showcase.v1beta1.EchoErrorDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsRequest.class, + com.google.showcase.v1beta1.EchoErrorDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsRequest.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(); + singleDetailText_ = ""; + + multiDetailText_ = 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_EchoErrorDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest build() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsRequest buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsRequest result = + new com.google.showcase.v1beta1.EchoErrorDetailsRequest(this); + int from_bitField0_ = bitField0_; + result.singleDetailText_ = singleDetailText_; + if (((bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = multiDetailText_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.multiDetailText_ = multiDetailText_; + 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.EchoErrorDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsRequest other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsRequest.getDefaultInstance()) + return this; + if (!other.getSingleDetailText().isEmpty()) { + singleDetailText_ = other.singleDetailText_; + onChanged(); + } + if (!other.multiDetailText_.isEmpty()) { + if (multiDetailText_.isEmpty()) { + multiDetailText_ = other.multiDetailText_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureMultiDetailTextIsMutable(); + multiDetailText_.addAll(other.multiDetailText_); + } + 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.EchoErrorDetailsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object singleDetailText_ = ""; + + /** + * + * + *
+     * Content to return in a singular `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + public java.lang.String getSingleDetailText() { + java.lang.Object ref = singleDetailText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + singleDetailText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Content to return in a singular `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + public com.google.protobuf.ByteString getSingleDetailTextBytes() { + java.lang.Object ref = singleDetailText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + singleDetailText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Content to return in a singular `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * string single_detail_text = 1; + * + * @param value The singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + singleDetailText_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Content to return in a singular `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * string single_detail_text = 1; + * + * @return This builder for chaining. + */ + public Builder clearSingleDetailText() { + + singleDetailText_ = getDefaultInstance().getSingleDetailText(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Content to return in a singular `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * string single_detail_text = 1; + * + * @param value The bytes for singleDetailText to set. + * @return This builder for chaining. + */ + public Builder setSingleDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + singleDetailText_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList multiDetailText_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMultiDetailTextIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + multiDetailText_ = new com.google.protobuf.LazyStringArrayList(multiDetailText_); + bitField0_ |= 0x00000001; + } + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + public com.google.protobuf.ProtocolStringList getMultiDetailTextList() { + return multiDetailText_.getUnmodifiableView(); + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + public int getMultiDetailTextCount() { + return multiDetailText_.size(); + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + public java.lang.String getMultiDetailText(int index) { + return multiDetailText_.get(index); + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + public com.google.protobuf.ByteString getMultiDetailTextBytes(int index) { + return multiDetailText_.getByteString(index); + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index to set the value at. + * @param value The multiDetailText to set. + * @return This builder for chaining. + */ + public Builder setMultiDetailText(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.set(index, value); + onChanged(); + return this; + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @param value The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureMultiDetailTextIsMutable(); + multiDetailText_.add(value); + onChanged(); + return this; + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @param values The multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addAllMultiDetailText(java.lang.Iterable values) { + ensureMultiDetailTextIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, multiDetailText_); + onChanged(); + return this; + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearMultiDetailText() { + multiDetailText_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * + * + *
+     * Content to return in a repeated `*.error.details` field of type
+     * `google.protobuf.Any`
+     * 
+ * + * repeated string multi_detail_text = 2; + * + * @param value The bytes of the multiDetailText to add. + * @return This builder for chaining. + */ + public Builder addMultiDetailTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureMultiDetailTextIsMutable(); + multiDetailText_.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.EchoErrorDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsRequest) + private static final com.google.showcase.v1beta1.EchoErrorDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsRequest(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoErrorDetailsRequest(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.EchoErrorDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..b104dfa891 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsRequestOrBuilder.java @@ -0,0 +1,111 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoErrorDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Content to return in a singular `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * string single_detail_text = 1; + * + * @return The singleDetailText. + */ + java.lang.String getSingleDetailText(); + + /** + * + * + *
+   * Content to return in a singular `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * string single_detail_text = 1; + * + * @return The bytes for singleDetailText. + */ + com.google.protobuf.ByteString getSingleDetailTextBytes(); + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @return A list containing the multiDetailText. + */ + java.util.List getMultiDetailTextList(); + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @return The count of multiDetailText. + */ + int getMultiDetailTextCount(); + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index of the element to return. + * @return The multiDetailText at the given index. + */ + java.lang.String getMultiDetailText(int index); + + /** + * + * + *
+   * Content to return in a repeated `*.error.details` field of type
+   * `google.protobuf.Any`
+   * 
+ * + * repeated string multi_detail_text = 2; + * + * @param index The index of the value to return. + * @return The bytes of the multiDetailText at the given index. + */ + com.google.protobuf.ByteString getMultiDetailTextBytes(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java new file mode 100644 index 0000000000..bce7281bf9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponse.java @@ -0,0 +1,2274 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * The response message used for the EchoErrorDetails method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ +public final class EchoErrorDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + EchoErrorDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use EchoErrorDetailsResponse.newBuilder() to construct. + private EchoErrorDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EchoErrorDetailsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EchoErrorDetailsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EchoErrorDetailsResponse( + 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.EchoErrorDetailsResponse.SingleDetail.Builder subBuilder = + null; + if (singleDetail_ != null) { + subBuilder = singleDetail_.toBuilder(); + } + singleDetail_ = + input.readMessage( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(singleDetail_); + singleDetail_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + subBuilder = null; + if (multipleDetails_ != null) { + subBuilder = multipleDetails_.toBuilder(); + } + multipleDetails_ = + input.readMessage( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(multipleDetails_); + multipleDetails_ = 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_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + public interface SingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithSingleDetail getError(); + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail} */ + public static final class SingleDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + SingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + // Use SingleDetail.newBuilder() to construct. + private SingleDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SingleDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SingleDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private SingleDetail( + 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.ErrorWithSingleDetail.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.showcase.v1beta1.ErrorWithSingleDetail.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_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder 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 (error_ != null) { + output.writeMessage(1, getError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, 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.EchoErrorDetailsResponse.SingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) obj; + + 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(); + 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.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.EchoErrorDetailsResponse.SingleDetail + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + 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.EchoErrorDetailsResponse.SingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail 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.EchoErrorDetailsResponse.SingleDetail 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.EchoErrorDetailsResponse.SingleDetail} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.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 (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_EchoErrorDetailsResponse_SingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(this); + 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.EchoErrorDetailsResponse.SingleDetail) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + .getDefaultInstance()) return this; + 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.EchoErrorDetailsResponse.SingleDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.ErrorWithSingleDetail error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithSingleDetail value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.showcase.v1beta1.ErrorWithSingleDetail.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + public com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithSingleDetail error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithSingleDetail, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder, + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder>( + 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.EchoErrorDetailsResponse.SingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SingleDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SingleDetail(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.EchoErrorDetailsResponse.SingleDetail + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface MultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.ErrorWithMultipleDetails getError(); + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder(); + } + + /** Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class MultipleDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + MultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use MultipleDetails.newBuilder() to construct. + private MultipleDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private MultipleDetails() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new MultipleDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private MultipleDetails( + 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.ErrorWithMultipleDetails.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.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_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder 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 (error_ != null) { + output.writeMessage(1, getError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, 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.EchoErrorDetailsResponse.MultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) obj; + + 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(); + 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.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.EchoErrorDetailsResponse.MultipleDetails + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + 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.EchoErrorDetailsResponse.MultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails 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.EchoErrorDetailsResponse.MultipleDetails 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.EchoErrorDetailsResponse.MultipleDetails} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder.class); + } + + // Construct using + // com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.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 (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_EchoErrorDetailsResponse_MultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(this); + 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.EchoErrorDetailsResponse.MultipleDetails) { + return mergeFrom( + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails other) { + if (other + == com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance()) return this; + 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.EchoErrorDetailsResponse.MultipleDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.ErrorWithMultipleDetails error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder setError( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.ErrorWithMultipleDetails value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.showcase.v1beta1.ErrorWithMultipleDetails.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + public com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.ErrorWithMultipleDetails error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.ErrorWithMultipleDetails, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder, + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder>( + 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.EchoErrorDetailsResponse.MultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public MultipleDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new MultipleDetails(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.EchoErrorDetailsResponse.MultipleDetails + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int SINGLE_DETAIL_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + @java.lang.Override + public boolean hasSingleDetail() { + return singleDetail_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + return getSingleDetail(); + } + + public static final int MULTIPLE_DETAILS_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + @java.lang.Override + public boolean hasMultipleDetails() { + return multipleDetails_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails() { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.getDefaultInstance() + : multipleDetails_; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + return getMultipleDetails(); + } + + 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 (singleDetail_ != null) { + output.writeMessage(1, getSingleDetail()); + } + if (multipleDetails_ != null) { + output.writeMessage(2, getMultipleDetails()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (singleDetail_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSingleDetail()); + } + if (multipleDetails_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getMultipleDetails()); + } + 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.EchoErrorDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.EchoErrorDetailsResponse other = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse) obj; + + if (hasSingleDetail() != other.hasSingleDetail()) return false; + if (hasSingleDetail()) { + if (!getSingleDetail().equals(other.getSingleDetail())) return false; + } + if (hasMultipleDetails() != other.hasMultipleDetails()) return false; + if (hasMultipleDetails()) { + if (!getMultipleDetails().equals(other.getMultipleDetails())) 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 (hasSingleDetail()) { + hash = (37 * hash) + SINGLE_DETAIL_FIELD_NUMBER; + hash = (53 * hash) + getSingleDetail().hashCode(); + } + if (hasMultipleDetails()) { + hash = (37 * hash) + MULTIPLE_DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getMultipleDetails().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.EchoErrorDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.EchoErrorDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.EchoErrorDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse 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.EchoErrorDetailsResponse 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 used for the EchoErrorDetails method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.EchoErrorDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.showcase.v1beta1.EchoErrorDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.class, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.EchoErrorDetailsResponse.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 (singleDetailBuilder_ == null) { + singleDetail_ = null; + } else { + singleDetail_ = null; + singleDetailBuilder_ = null; + } + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = null; + } else { + multipleDetails_ = null; + multipleDetailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse build() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.EchoErrorDetailsResponse buildPartial() { + com.google.showcase.v1beta1.EchoErrorDetailsResponse result = + new com.google.showcase.v1beta1.EchoErrorDetailsResponse(this); + if (singleDetailBuilder_ == null) { + result.singleDetail_ = singleDetail_; + } else { + result.singleDetail_ = singleDetailBuilder_.build(); + } + if (multipleDetailsBuilder_ == null) { + result.multipleDetails_ = multipleDetails_; + } else { + result.multipleDetails_ = multipleDetailsBuilder_.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.EchoErrorDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.EchoErrorDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.EchoErrorDetailsResponse other) { + if (other == com.google.showcase.v1beta1.EchoErrorDetailsResponse.getDefaultInstance()) + return this; + if (other.hasSingleDetail()) { + mergeSingleDetail(other.getSingleDetail()); + } + if (other.hasMultipleDetails()) { + mergeMultipleDetails(other.getMultipleDetails()); + } + 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.EchoErrorDetailsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.EchoErrorDetailsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail singleDetail_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + singleDetailBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return Whether the singleDetail field is set. + */ + public boolean hasSingleDetail() { + return singleDetailBuilder_ != null || singleDetail_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * + * @return The singleDetail. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail() { + if (singleDetailBuilder_ == null) { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } else { + return singleDetailBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + singleDetail_ = value; + onChanged(); + } else { + singleDetailBuilder_.setMessage(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder setSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder builderForValue) { + if (singleDetailBuilder_ == null) { + singleDetail_ = builderForValue.build(); + onChanged(); + } else { + singleDetailBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder mergeSingleDetail( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail value) { + if (singleDetailBuilder_ == null) { + if (singleDetail_ != null) { + singleDetail_ = + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.newBuilder( + singleDetail_) + .mergeFrom(value) + .buildPartial(); + } else { + singleDetail_ = value; + } + onChanged(); + } else { + singleDetailBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public Builder clearSingleDetail() { + if (singleDetailBuilder_ == null) { + singleDetail_ = null; + onChanged(); + } else { + singleDetail_ = null; + singleDetailBuilder_ = null; + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder + getSingleDetailBuilder() { + + onChanged(); + return getSingleDetailFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder() { + if (singleDetailBuilder_ != null) { + return singleDetailBuilder_.getMessageOrBuilder(); + } else { + return singleDetail_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.getDefaultInstance() + : singleDetail_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder> + getSingleDetailFieldBuilder() { + if (singleDetailBuilder_ == null) { + singleDetailBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder>( + getSingleDetail(), getParentForChildren(), isClean()); + singleDetail_ = null; + } + return singleDetailBuilder_; + } + + private com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multipleDetails_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + multipleDetailsBuilder_; + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + public boolean hasMultipleDetails() { + return multipleDetailsBuilder_ != null || multipleDetails_ != null; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + getMultipleDetails() { + if (multipleDetailsBuilder_ == null) { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } else { + return multipleDetailsBuilder_.getMessage(); + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + multipleDetails_ = value; + onChanged(); + } else { + multipleDetailsBuilder_.setMessage(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder setMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + builderForValue) { + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = builderForValue.build(); + onChanged(); + } else { + multipleDetailsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder mergeMultipleDetails( + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails value) { + if (multipleDetailsBuilder_ == null) { + if (multipleDetails_ != null) { + multipleDetails_ = + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.newBuilder( + multipleDetails_) + .mergeFrom(value) + .buildPartial(); + } else { + multipleDetails_ = value; + } + onChanged(); + } else { + multipleDetailsBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public Builder clearMultipleDetails() { + if (multipleDetailsBuilder_ == null) { + multipleDetails_ = null; + onChanged(); + } else { + multipleDetails_ = null; + multipleDetailsBuilder_ = null; + } + + return this; + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder + getMultipleDetailsBuilder() { + + onChanged(); + return getMultipleDetailsFieldBuilder().getBuilder(); + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + public com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder() { + if (multipleDetailsBuilder_ != null) { + return multipleDetailsBuilder_.getMessageOrBuilder(); + } else { + return multipleDetails_ == null + ? com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails + .getDefaultInstance() + : multipleDetails_; + } + } + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder> + getMultipleDetailsFieldBuilder() { + if (multipleDetailsBuilder_ == null) { + multipleDetailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails.Builder, + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder>( + getMultipleDetails(), getParentForChildren(), isClean()); + multipleDetails_ = null; + } + return multipleDetailsBuilder_; + } + + @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.EchoErrorDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.EchoErrorDetailsResponse) + private static final com.google.showcase.v1beta1.EchoErrorDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.EchoErrorDetailsResponse(); + } + + public static com.google.showcase.v1beta1.EchoErrorDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EchoErrorDetailsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EchoErrorDetailsResponse(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.EchoErrorDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..bb1f10f76c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoErrorDetailsResponseOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface EchoErrorDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.EchoErrorDetailsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return Whether the singleDetail field is set. + */ + boolean hasSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + * + * @return The singleDetail. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail getSingleDetail(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetail single_detail = 1; + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.SingleDetailOrBuilder + getSingleDetailOrBuilder(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return Whether the multipleDetails field is set. + */ + boolean hasMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + * + * @return The multipleDetails. + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails getMultipleDetails(); + + /** + * .google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails multiple_details = 2; + * + */ + com.google.showcase.v1beta1.EchoErrorDetailsResponse.MultipleDetailsOrBuilder + getMultipleDetailsOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java new file mode 100644 index 0000000000..5c73f5d3e1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java @@ -0,0 +1,506 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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_EchoErrorDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_PoetryError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_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\033go" + + "ogle/api/field_info.proto\032\030google/api/ro" + + "uting.proto\032#google/longrunning/operatio" + + "ns.proto\032\031google/protobuf/any.proto\032\036goo" + + "gle/protobuf/duration.proto\032\037google/prot" + + "obuf/timestamp.proto\032\027google/rpc/status.proto\"\210\002\n" + + "\013EchoRequest\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" + + "\006header\030\004 \001(\t\022\024\n" + + "\014other_header\030\005 \001(\t\022\034\n\n" + + "request_id\030\007 \001(\tB\010\342\214\317\327\010\002\010\001\022\'\n" + + "\020other_request_id\030\010 \001(" + + "\tB\010\342\214\317\327\010\002\010\001H\001\210\001\001B\n\n" + + "\010responseB\023\n" + + "\021_other_request_id\"\202\001\n" + + "\014EchoResponse\022\017\n" + + "\007content\030\001 \001(\t\0223\n" + + "\010severity\030\002 \001(\0162!.google.showcase.v1beta1.Severity\022\022\n\n" + + "request_id\030\003 \001(\t\022\030\n" + + "\020other_request_id\030\004 \001(\t\"P\n" + + "\027EchoErrorDetailsRequest\022\032\n" + + "\022single_detail_text\030\001 \001(\t\022\031\n" + + "\021multi_detail_text\030\002 \003(\t\"\362\002\n" + + "\030EchoErrorDetailsResponse\022U\n\r" + + "single_detail\030\001 \001(\0132>.google.showcase.v1" + + "beta1.EchoErrorDetailsResponse.SingleDetail\022[\n" + + "\020multiple_details\030\002 \001(\0132A.google.s" + + "howcase.v1beta1.EchoErrorDetailsResponse.MultipleDetails\032M\n" + + "\014SingleDetail\022=\n" + + "\005error\030\001 \001(\0132..google.showcase.v1beta1.ErrorWithSingleDetail\032S\n" + + "\017MultipleDetails\022@\n" + + "\005error\030\001 \001(\01321.google.showcase.v1beta1.ErrorWithMultipleDetails\">\n" + + "\025ErrorWithSingleDetail\022%\n" + + "\007details\030\001 \001(\0132\024.google.protobuf.Any\"A\n" + + "\030ErrorWithMultipleDetails\022%\n" + + "\007details\030\001 \003(\0132\024.google.protobuf.Any\"\033\n" + + "\013PoetryError\022\014\n" + + "\004poem\030\001 \001(\t\"-\n" + + "\032FailEchoWithDetailsRequest\022\017\n" + + "\007message\030\001 \001(\t\"\035\n" + + "\033FailEchoWithDetailsResponse\"x\n\r" + + "ExpandRequest\022\017\n" + + "\007content\030\001 \001(\t\022!\n" + + "\005error\030\002 \001(\0132\022.google.rpc.Status\0223\n" + + "\020stream_wait_time\030\003 \001(\0132\031.google.protobuf.Duration\"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\n" + + "page_token\030\003 \001(\t\"Y\n" + + "\030PagedExpandLegacyRequest\022\024\n" + + "\007content\030\001 \001(\tB\003\340A\002\022\023\n" + + "\013max_results\030\002 \001(\005\022\022\n\n" + + "page_token\030\003 \001(\t\"h\n" + + "\023PagedExpandResponse\0228\n" + + "\tresponses\030\001 \003(\0132%.google.showcase.v1beta1.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(\013" + + "2J.google.showcase.v1beta1.PagedExpandLegacyMappedResponse.AlphabetizedEntry\022\027\n" + + "\017next_page_token\030\002 \001(\t\032e\n" + + "\021AlphabetizedEntry\022\013\n" + + "\003key\030\001 \001(\t\022?\n" + + "\005value\030\002 \001(\01320.google." + + "showcase.v1beta1.PagedExpandResponseList:\0028\001\"\331\001\n" + + "\013WaitRequest\022.\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.TimestampH\000\022(\n" + + "\003ttl\030\004 \001(\0132\031.google.protobuf.DurationH\000\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\001\0228\n" + + "\007success\030\003 \001(\0132%.google.showcase.v1beta1.WaitResponseH\001B\005\n" + + "\003endB\n\n" + + "\010response\"\037\n" + + "\014WaitResponse\022\017\n" + + "\007content\030\001 \001(\t\"<\n" + + "\014WaitMetadata\022,\n" + + "\010end_time\030\001 \001(\0132\032.google.protobuf.Timestamp\"\255\001\n" + + "\014BlockRequest\0221\n" + + "\016response_delay\030\001 \001(\0132\031.google.protobuf.Duration\022#\n" + + "\005error\030\002 \001(\0132\022.google.rpc.StatusH\000\0229\n" + + "\007success\030\003 \001(\0132&.google.showcase.v1beta1.BlockResponseH\000B\n\n" + + "\010response\" \n\r" + + "BlockResponse\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" + + "\006URGENT\020\002\022\014\n" + + "\010CRITICAL\020\0032\337\016\n" + + "\004Echo\022\224\003\n" + + "\004Echo\022$.google.showcase.v1beta1.EchoRequest\032%.google.showcase.v1beta" + + "1.EchoResponse\"\276\002\202\323\344\223\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n" + + "\006header\022\031\n" + + "\006header\022\017{routing_id=**}\022+\n" + + "\006header\022!{table_name=regions/*/zones/*/**}\022\"\n" + + "\006header\022\030{super_id=projects/*}/**\0220\n" + + "\006header\022&{table_name=projects/*/instances/*/**}\0221\n" + + "\006header\022\'projects/*/{instance_id=instances/*}/**\022\030\n" + + "\014other_header\022\010{baz=**}\022#\n" + + "\014other_header\022\023{qux=projects/*}/**\022\237\001\n" + + "\020EchoErrorDetails\0220.google.showcase.v1beta1.EchoErrorDetailsR" + + "equest\0321.google.showcase.v1beta1.EchoErrorDetailsResponse\"&\202\323\344\223\002" + + " \"\033/v1beta1/echo:error-details:\001*\022\252\001\n" + + "\023FailEchoWithDetails\0223.google.showcase.v1beta1.FailEchoWith" + + "DetailsRequest\0324.google.showcase.v1beta1" + + ".FailEchoWithDetailsResponse\"(\202\323\344\223\002\"\"\035/v1beta1/echo:failWithDetails:\001*\022\212\001\n" + + "\006Expand\022&.google.showcase.v1beta1.ExpandReques" + + "t\032%.google.showcase.v1beta1.EchoResponse\"/\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*\332A\r" + + "content,error0\001\022z\n" + + "\007Collect\022$.google.showcase" + + ".v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse\"" + + " \202\323\344\223\002\032\"\025/v1beta1/echo:collect:\001*(\001\022W\n" + + "\004Chat\022$.google.showcas" + + "e.v1beta1.EchoRequest\032%.google.showcase.v1beta1.EchoResponse(\0010\001\022\216\001\n" + + "\013PagedExpand\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\032,.google.showcase.v1beta1.PagedExp" + + "andResponse\"$\202\323\344\223\002\036\"\031/v1beta1/echo:pagedExpand:\001*\022\240\001\n" + + "\021PagedExpandLegacy\0221.google.showcase.v1beta1.PagedExpandLegacyReque" + + "st\032,.google.showcase.v1beta1.PagedExpand" + + "Response\"*\202\323\344\223\002$\"\037/v1beta1/echo:pagedExpandLegacy:\001*\022\262\001\n" + + "\027PagedExpandLegacyMapped\022+.google.showcase.v1beta1.PagedExpandRe" + + "quest\0328.google.showcase.v1beta1.PagedExp" + + "andLegacyMappedResponse\"0\202\323\344\223\002*\"%/v1beta1/echo:pagedExpandLegacyMapped:\001*\022\211\001\n" + + "\004Wait\022$.google.showcase.v1beta1.WaitRequest" + + "\032\035.google.longrunning.Operation\"<\202\323\344\223\002\027\"\022/v1beta1/echo:wait:\001*\312A\034\n" + + "\014WaitResponse\022\014WaitMetadata\022v\n" + + "\005Block\022%.google.showcase.v1beta1.BlockRequest\032&.google.showcase." + + "v1beta1.BlockResponse\"\036\202\323\344\223\002\030\"\023/v1beta1/" + + "echo:block:\001*\032\"\312A\016localhost:7469\212\324\333\322\017\013v1_20240408Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/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.FieldBehaviorProto.getDescriptor(), + com.google.api.FieldInfoProto.getDescriptor(), + com.google.api.RoutingProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.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", + "RequestId", + "OtherRequestId", + "Response", + "OtherRequestId", + }); + 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", "RequestId", "OtherRequestId", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsRequest_descriptor, + new java.lang.String[] { + "SingleDetailText", "MultiDetailText", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor, + new java.lang.String[] { + "SingleDetail", "MultipleDetails", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor + .getNestedTypes() + .get(0); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_SingleDetail_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor = + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_descriptor + .getNestedTypes() + .get(1); + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_EchoErrorDetailsResponse_MultipleDetails_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor, + new java.lang.String[] { + "Details", + }); + internal_static_google_showcase_v1beta1_PoetryError_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_PoetryError_descriptor, + new java.lang.String[] { + "Poem", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor, + new java.lang.String[] { + "Message", + }); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + 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", "StreamWaitTime", + }); + internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + 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(11); + 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(12); + 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(13); + 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(14); + 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(15); + 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(16); + 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(17); + 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(18); + 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(19); + 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.apiVersion); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.FieldInfoProto.fieldInfo); + 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.FieldInfoProto.getDescriptor(); + com.google.api.RoutingProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java new file mode 100644 index 0000000000..762a037753 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequest.java @@ -0,0 +1,2039 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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_ = ""; + requestId_ = ""; + otherRequestId_ = ""; + } + + @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(); + } + 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(); + 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; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + otherRequestId_ = 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 bitField0_; + 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; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 7; + private volatile java.lang.Object requestId_; + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 8; + private volatile java.lang.Object otherRequestId_; + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + @java.lang.Override + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, otherRequestId_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, requestId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, otherRequestId_); + } + 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 (!getRequestId().equals(other.getRequestId())) return false; + if (hasOtherRequestId() != other.hasOtherRequestId()) return false; + if (hasOtherRequestId()) { + if (!getOtherRequestId().equals(other.getOtherRequestId())) 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(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + if (hasOtherRequestId()) { + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().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_ = ""; + + requestId_ = ""; + + otherRequestId_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + 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); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + 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.requestId_ = requestId_; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.otherRequestId_ = otherRequestId_; + result.bitField0_ = to_bitField0_; + 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(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (other.hasOtherRequestId()) { + bitField0_ |= 0x00000001; + otherRequestId_ = other.otherRequestId_; + 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; + } + + private int bitField0_; + + /** + * + * + *
+     * 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; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + public boolean hasOtherRequestId() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + otherRequestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + bitField0_ = (bitField0_ & ~0x00000001); + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
+     * To facilitate testing of https://google.aip.dev/client-libraries/4235
+     * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + bitField0_ |= 0x00000001; + otherRequestId_ = 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java new file mode 100644 index 0000000000..6abd7f146d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoRequestOrBuilder.java @@ -0,0 +1,246 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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(); + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * string request_id = 7 [(.google.api.field_info) = { ... } + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return Whether the otherRequestId field is set. + */ + boolean hasOtherRequestId(); + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
+   * To facilitate testing of https://google.aip.dev/client-libraries/4235
+   * 
+ * + * optional string other_request_id = 8 [(.google.api.field_info) = { ... } + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); + + public com.google.showcase.v1beta1.EchoRequest.ResponseCase getResponseCase(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java new file mode 100644 index 0000000000..78616eba8e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponse.java @@ -0,0 +1,1173 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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; + requestId_ = ""; + otherRequestId_ = ""; + } + + @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; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + otherRequestId_ = 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_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; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + + /** + * + * + *
+   * The request ID specified or autopopulated in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + + /** + * + * + *
+   * The request ID specified or autopopulated in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OTHER_REQUEST_ID_FIELD_NUMBER = 4; + private volatile java.lang.Object otherRequestId_; + + /** + * + * + *
+   * The other request ID specified or autopopulated in the request.
+   * 
+ * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + @java.lang.Override + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + 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(); + otherRequestId_ = s; + return s; + } + } + + /** + * + * + *
+   * The other request ID specified or autopopulated in the request.
+   * 
+ * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = 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 (severity_ != com.google.showcase.v1beta1.Severity.UNNECESSARY.getNumber()) { + output.writeEnum(2, severity_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherRequestId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, otherRequestId_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(requestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(otherRequestId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, otherRequestId_); + } + 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 (!getRequestId().equals(other.getRequestId())) return false; + if (!getOtherRequestId().equals(other.getOtherRequestId())) 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 = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + OTHER_REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getOtherRequestId().hashCode(); + 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; + + requestId_ = ""; + + otherRequestId_ = ""; + + 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_; + result.requestId_ = requestId_; + result.otherRequestId_ = otherRequestId_; + 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()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getOtherRequestId().isEmpty()) { + otherRequestId_ = other.otherRequestId_; + 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.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; + } + + private java.lang.Object requestId_ = ""; + + /** + * + * + *
+     * The request ID specified or autopopulated in the request.
+     * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The request ID specified or autopopulated in the request.
+     * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The request ID specified or autopopulated in the request.
+     * 
+ * + * string request_id = 3; + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The request ID specified or autopopulated in the request.
+     * 
+ * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The request ID specified or autopopulated in the request.
+     * 
+ * + * string request_id = 3; + * + * @param value The bytes for requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object otherRequestId_ = ""; + + /** + * + * + *
+     * The other request ID specified or autopopulated in the request.
+     * 
+ * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + public java.lang.String getOtherRequestId() { + java.lang.Object ref = otherRequestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + otherRequestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * The other request ID specified or autopopulated in the request.
+     * 
+ * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + public com.google.protobuf.ByteString getOtherRequestIdBytes() { + java.lang.Object ref = otherRequestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + otherRequestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * The other request ID specified or autopopulated in the request.
+     * 
+ * + * string other_request_id = 4; + * + * @param value The otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + otherRequestId_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The other request ID specified or autopopulated in the request.
+     * 
+ * + * string other_request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearOtherRequestId() { + + otherRequestId_ = getDefaultInstance().getOtherRequestId(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The other request ID specified or autopopulated in the request.
+     * 
+ * + * string other_request_id = 4; + * + * @param value The bytes for otherRequestId to set. + * @return This builder for chaining. + */ + public Builder setOtherRequestIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + otherRequestId_ = 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.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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java new file mode 100644 index 0000000000..06a060f86b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoResponseOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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(); + + /** + * + * + *
+   * The request ID specified or autopopulated in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + + /** + * + * + *
+   * The request ID specified or autopopulated in the request.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); + + /** + * + * + *
+   * The other request ID specified or autopopulated in the request.
+   * 
+ * + * string other_request_id = 4; + * + * @return The otherRequestId. + */ + java.lang.String getOtherRequestId(); + + /** + * + * + *
+   * The other request ID specified or autopopulated in the request.
+   * 
+ * + * string other_request_id = 4; + * + * @return The bytes for otherRequestId. + */ + com.google.protobuf.ByteString getOtherRequestIdBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java new file mode 100644 index 0000000000..063ccca508 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java @@ -0,0 +1,535 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 declared 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 declared 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 declared 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 declared 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java new file mode 100644 index 0000000000..69854016d5 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java @@ -0,0 +1,38 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 declared in this proto file.
+   * 
+ * + * bool unknown_enum = 1; + * + * @return The unknownEnum. + */ + boolean getUnknownEnum(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java new file mode 100644 index 0000000000..07f3f02cde --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponse.java @@ -0,0 +1,888 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java new file mode 100644 index 0000000000..24aa273d73 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumResponseOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java new file mode 100644 index 0000000000..6cbd143ea7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetails.java @@ -0,0 +1,765 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithMultipleDetails} */ +public final class ErrorWithMultipleDetails extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + ErrorWithMultipleDetailsOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ErrorWithMultipleDetails.newBuilder() to construct. + private ErrorWithMultipleDetails(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ErrorWithMultipleDetails() { + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ErrorWithMultipleDetails(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ErrorWithMultipleDetails( + 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)) { + details_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + details_.add(input.readMessage(com.google.protobuf.Any.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)) { + details_ = java.util.Collections.unmodifiableList(details_); + } + 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_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + private java.util.List details_; + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.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 < details_.size(); i++) { + output.writeMessage(1, details_.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 < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, details_.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.ErrorWithMultipleDetails)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithMultipleDetails other = + (com.google.showcase.v1beta1.ErrorWithMultipleDetails) obj; + + if (!getDetailsList().equals(other.getDetailsList())) 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 (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.ErrorWithMultipleDetails parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.ErrorWithMultipleDetails parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.ErrorWithMultipleDetails parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails 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.ErrorWithMultipleDetails 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.ErrorWithMultipleDetails} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.showcase.v1beta1.ErrorWithMultipleDetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithMultipleDetails.class, + com.google.showcase.v1beta1.ErrorWithMultipleDetails.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithMultipleDetails.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + detailsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithMultipleDetails_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails build() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithMultipleDetails buildPartial() { + com.google.showcase.v1beta1.ErrorWithMultipleDetails result = + new com.google.showcase.v1beta1.ErrorWithMultipleDetails(this); + int from_bitField0_ = bitField0_; + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.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.ErrorWithMultipleDetails) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithMultipleDetails) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithMultipleDetails other) { + if (other == com.google.showcase.v1beta1.ErrorWithMultipleDetails.getDefaultInstance()) + return this; + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + 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.ErrorWithMultipleDetails parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ErrorWithMultipleDetails) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return getDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** repeated .google.protobuf.Any details = 1; */ + public java.util.List getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.ErrorWithMultipleDetails) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithMultipleDetails) + private static final com.google.showcase.v1beta1.ErrorWithMultipleDetails DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithMultipleDetails(); + } + + public static com.google.showcase.v1beta1.ErrorWithMultipleDetails getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithMultipleDetails parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ErrorWithMultipleDetails(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.ErrorWithMultipleDetails getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java new file mode 100644 index 0000000000..2192bf7742 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithMultipleDetailsOrBuilder.java @@ -0,0 +1,40 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface ErrorWithMultipleDetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithMultipleDetails) + com.google.protobuf.MessageOrBuilder { + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.Any getDetails(int index); + + /** repeated .google.protobuf.Any details = 1; */ + int getDetailsCount(); + + /** repeated .google.protobuf.Any details = 1; */ + java.util.List getDetailsOrBuilderList(); + + /** repeated .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java new file mode 100644 index 0000000000..351b0407dc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetail.java @@ -0,0 +1,633 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.ErrorWithSingleDetail} */ +public final class ErrorWithSingleDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + ErrorWithSingleDetailOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ErrorWithSingleDetail.newBuilder() to construct. + private ErrorWithSingleDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ErrorWithSingleDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ErrorWithSingleDetail(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ErrorWithSingleDetail( + 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.Any.Builder subBuilder = null; + if (details_ != null) { + subBuilder = details_.toBuilder(); + } + details_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(details_); + details_ = 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_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + public static final int DETAILS_FIELD_NUMBER = 1; + private com.google.protobuf.Any details_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return details_ != null; + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + @java.lang.Override + public com.google.protobuf.Any getDetails() { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + + /** .google.protobuf.Any details = 1; */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + return getDetails(); + } + + 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 (details_ != null) { + output.writeMessage(1, getDetails()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (details_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDetails()); + } + 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.ErrorWithSingleDetail)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.ErrorWithSingleDetail other = + (com.google.showcase.v1beta1.ErrorWithSingleDetail) obj; + + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) 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 (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.ErrorWithSingleDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.ErrorWithSingleDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.ErrorWithSingleDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.ErrorWithSingleDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail 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.ErrorWithSingleDetail 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.ErrorWithSingleDetail} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.showcase.v1beta1.ErrorWithSingleDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.ErrorWithSingleDetail.class, + com.google.showcase.v1beta1.ErrorWithSingleDetail.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.ErrorWithSingleDetail.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 (detailsBuilder_ == null) { + details_ = null; + } else { + details_ = null; + detailsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_ErrorWithSingleDetail_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstanceForType() { + return com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail build() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.ErrorWithSingleDetail buildPartial() { + com.google.showcase.v1beta1.ErrorWithSingleDetail result = + new com.google.showcase.v1beta1.ErrorWithSingleDetail(this); + if (detailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.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.ErrorWithSingleDetail) { + return mergeFrom((com.google.showcase.v1beta1.ErrorWithSingleDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.ErrorWithSingleDetail other) { + if (other == com.google.showcase.v1beta1.ErrorWithSingleDetail.getDefaultInstance()) + return this; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + 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.ErrorWithSingleDetail parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.ErrorWithSingleDetail) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Any details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return detailsBuilder_ != null || details_ != null; + } + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + public com.google.protobuf.Any getDetails() { + if (detailsBuilder_ == null) { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + detailsBuilder_.setMessage(value); + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder setDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder mergeDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (details_ != null) { + details_ = com.google.protobuf.Any.newBuilder(details_).mergeFrom(value).buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + detailsBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = null; + onChanged(); + } else { + details_ = null; + detailsBuilder_ = null; + } + + return this; + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.Any.Builder getDetailsBuilder() { + + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + + /** .google.protobuf.Any details = 1; */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null ? com.google.protobuf.Any.getDefaultInstance() : details_; + } + } + + /** .google.protobuf.Any details = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>(getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.ErrorWithSingleDetail) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.ErrorWithSingleDetail) + private static final com.google.showcase.v1beta1.ErrorWithSingleDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.ErrorWithSingleDetail(); + } + + public static com.google.showcase.v1beta1.ErrorWithSingleDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ErrorWithSingleDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ErrorWithSingleDetail(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.ErrorWithSingleDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java new file mode 100644 index 0000000000..adbe5e8f8b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ErrorWithSingleDetailOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface ErrorWithSingleDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.ErrorWithSingleDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Any details = 1; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + + /** + * .google.protobuf.Any details = 1; + * + * @return The details. + */ + com.google.protobuf.Any getDetails(); + + /** .google.protobuf.Any details = 1; */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java new file mode 100644 index 0000000000..b390ae638a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequest.java @@ -0,0 +1,1206 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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; + } + case 26: + { + com.google.protobuf.Duration.Builder subBuilder = null; + if (streamWaitTime_ != null) { + subBuilder = streamWaitTime_.toBuilder(); + } + streamWaitTime_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(streamWaitTime_); + streamWaitTime_ = 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(); + } + + public static final int STREAM_WAIT_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Duration streamWaitTime_; + + /** + * + * + *
+   * The wait time between each server streaming messages
+   * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + @java.lang.Override + public boolean hasStreamWaitTime() { + return streamWaitTime_ != null; + } + + /** + * + * + *
+   * The wait time between each server streaming messages
+   * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + @java.lang.Override + public com.google.protobuf.Duration getStreamWaitTime() { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + + /** + * + * + *
+   * The wait time between each server streaming messages
+   * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + @java.lang.Override + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + return getStreamWaitTime(); + } + + 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()); + } + if (streamWaitTime_ != null) { + output.writeMessage(3, getStreamWaitTime()); + } + 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()); + } + if (streamWaitTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStreamWaitTime()); + } + 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 (hasStreamWaitTime() != other.hasStreamWaitTime()) return false; + if (hasStreamWaitTime()) { + if (!getStreamWaitTime().equals(other.getStreamWaitTime())) 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(); + } + if (hasStreamWaitTime()) { + hash = (37 * hash) + STREAM_WAIT_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStreamWaitTime().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; + } + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = null; + } else { + streamWaitTime_ = null; + streamWaitTimeBuilder_ = 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(); + } + if (streamWaitTimeBuilder_ == null) { + result.streamWaitTime_ = streamWaitTime_; + } else { + result.streamWaitTime_ = streamWaitTimeBuilder_.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()); + } + if (other.hasStreamWaitTime()) { + mergeStreamWaitTime(other.getStreamWaitTime()); + } + 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_; + } + + private com.google.protobuf.Duration streamWaitTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + streamWaitTimeBuilder_; + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + public boolean hasStreamWaitTime() { + return streamWaitTimeBuilder_ != null || streamWaitTime_ != null; + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + public com.google.protobuf.Duration getStreamWaitTime() { + if (streamWaitTimeBuilder_ == null) { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } else { + return streamWaitTimeBuilder_.getMessage(); + } + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + streamWaitTime_ = value; + onChanged(); + } else { + streamWaitTimeBuilder_.setMessage(value); + } + + return this; + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder setStreamWaitTime(com.google.protobuf.Duration.Builder builderForValue) { + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = builderForValue.build(); + onChanged(); + } else { + streamWaitTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder mergeStreamWaitTime(com.google.protobuf.Duration value) { + if (streamWaitTimeBuilder_ == null) { + if (streamWaitTime_ != null) { + streamWaitTime_ = + com.google.protobuf.Duration.newBuilder(streamWaitTime_) + .mergeFrom(value) + .buildPartial(); + } else { + streamWaitTime_ = value; + } + onChanged(); + } else { + streamWaitTimeBuilder_.mergeFrom(value); + } + + return this; + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public Builder clearStreamWaitTime() { + if (streamWaitTimeBuilder_ == null) { + streamWaitTime_ = null; + onChanged(); + } else { + streamWaitTime_ = null; + streamWaitTimeBuilder_ = null; + } + + return this; + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.Duration.Builder getStreamWaitTimeBuilder() { + + onChanged(); + return getStreamWaitTimeFieldBuilder().getBuilder(); + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + public com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder() { + if (streamWaitTimeBuilder_ != null) { + return streamWaitTimeBuilder_.getMessageOrBuilder(); + } else { + return streamWaitTime_ == null + ? com.google.protobuf.Duration.getDefaultInstance() + : streamWaitTime_; + } + } + + /** + * + * + *
+     * The wait time between each server streaming messages
+     * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder> + getStreamWaitTimeFieldBuilder() { + if (streamWaitTimeBuilder_ == null) { + streamWaitTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, + com.google.protobuf.Duration.Builder, + com.google.protobuf.DurationOrBuilder>( + getStreamWaitTime(), getParentForChildren(), isClean()); + streamWaitTime_ = null; + } + return streamWaitTimeBuilder_; + } + + @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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java new file mode 100644 index 0000000000..ae2335873e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ExpandRequestOrBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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(); + + /** + * + * + *
+   * The wait time between each server streaming messages
+   * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return Whether the streamWaitTime field is set. + */ + boolean hasStreamWaitTime(); + + /** + * + * + *
+   * The wait time between each server streaming messages
+   * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + * + * @return The streamWaitTime. + */ + com.google.protobuf.Duration getStreamWaitTime(); + + /** + * + * + *
+   * The wait time between each server streaming messages
+   * 
+ * + * .google.protobuf.Duration stream_wait_time = 3; + */ + com.google.protobuf.DurationOrBuilder getStreamWaitTimeOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java new file mode 100644 index 0000000000..21fcc8ec64 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java @@ -0,0 +1,655 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * The request message used for the FailEchoWithDetails method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ +public final class FailEchoWithDetailsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + FailEchoWithDetailsRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FailEchoWithDetailsRequest.newBuilder() to construct. + private FailEchoWithDetailsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsRequest() { + message_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailEchoWithDetailsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FailEchoWithDetailsRequest( + 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(); + + message_ = 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_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + public static final int MESSAGE_FIELD_NUMBER = 1; + private volatile java.lang.Object message_; + + /** + * + * + *
+   * Optional message to echo back in the PoetryError. If empty, a value will be
+   * provided.
+   * 
+ * + * string message = 1; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
+   * Optional message to echo back in the PoetryError. If empty, a value will be
+   * provided.
+   * 
+ * + * string message = 1; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = 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(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); + } + 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(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); + } + 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.FailEchoWithDetailsRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsRequest other = + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) obj; + + if (!getMessage().equals(other.getMessage())) 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) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.FailEchoWithDetailsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.FailEchoWithDetailsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.FailEchoWithDetailsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest 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.FailEchoWithDetailsRequest 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 FailEchoWithDetails method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.showcase.v1beta1.FailEchoWithDetailsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.class, + com.google.showcase.v1beta1.FailEchoWithDetailsRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsRequest.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(); + message_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest build() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsRequest buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsRequest result = + new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(this); + result.message_ = message_; + 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.FailEchoWithDetailsRequest) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsRequest other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsRequest.getDefaultInstance()) + return this; + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + 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.FailEchoWithDetailsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.FailEchoWithDetailsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+     * Optional message to echo back in the PoetryError. If empty, a value will be
+     * provided.
+     * 
+ * + * string message = 1; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+     * Optional message to echo back in the PoetryError. If empty, a value will be
+     * provided.
+     * 
+ * + * string message = 1; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+     * Optional message to echo back in the PoetryError. If empty, a value will be
+     * provided.
+     * 
+ * + * string message = 1; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional message to echo back in the PoetryError. If empty, a value will be
+     * provided.
+     * 
+ * + * string message = 1; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + + /** + * + * + *
+     * Optional message to echo back in the PoetryError. If empty, a value will be
+     * provided.
+     * 
+ * + * string message = 1; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = 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.FailEchoWithDetailsRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsRequest) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsRequest(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FailEchoWithDetailsRequest(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.FailEchoWithDetailsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..ce0fea97b9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java @@ -0,0 +1,53 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface FailEchoWithDetailsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional message to echo back in the PoetryError. If empty, a value will be
+   * provided.
+   * 
+ * + * string message = 1; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+   * Optional message to echo back in the PoetryError. If empty, a value will be
+   * provided.
+   * 
+ * + * string message = 1; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java new file mode 100644 index 0000000000..95486c63e4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java @@ -0,0 +1,463 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * The response message declared (but never used) for the FailEchoWithDetails
+ * method.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ +public final class FailEchoWithDetailsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + FailEchoWithDetailsResponseOrBuilder { + private static final long serialVersionUID = 0L; + + // Use FailEchoWithDetailsResponse.newBuilder() to construct. + private FailEchoWithDetailsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FailEchoWithDetailsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FailEchoWithDetailsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FailEchoWithDetailsResponse( + 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; + 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_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.Builder.class); + } + + 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 { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + 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.FailEchoWithDetailsResponse)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.FailEchoWithDetailsResponse other = + (com.google.showcase.v1beta1.FailEchoWithDetailsResponse) obj; + + 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.FailEchoWithDetailsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.FailEchoWithDetailsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.FailEchoWithDetailsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse 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.FailEchoWithDetailsResponse 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 declared (but never used) for the FailEchoWithDetails
+   * method.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.FailEchoWithDetailsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.showcase.v1beta1.FailEchoWithDetailsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.class, + com.google.showcase.v1beta1.FailEchoWithDetailsResponse.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.FailEchoWithDetailsResponse.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(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_FailEchoWithDetailsResponse_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return com.google.showcase.v1beta1.FailEchoWithDetailsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse build() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.FailEchoWithDetailsResponse buildPartial() { + com.google.showcase.v1beta1.FailEchoWithDetailsResponse result = + new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(this); + 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.FailEchoWithDetailsResponse) { + return mergeFrom((com.google.showcase.v1beta1.FailEchoWithDetailsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.FailEchoWithDetailsResponse other) { + if (other == com.google.showcase.v1beta1.FailEchoWithDetailsResponse.getDefaultInstance()) + return this; + 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.FailEchoWithDetailsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.FailEchoWithDetailsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + 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.FailEchoWithDetailsResponse) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.FailEchoWithDetailsResponse) + private static final com.google.showcase.v1beta1.FailEchoWithDetailsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.FailEchoWithDetailsResponse(); + } + + public static com.google.showcase.v1beta1.FailEchoWithDetailsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FailEchoWithDetailsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FailEchoWithDetailsResponse(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.FailEchoWithDetailsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..55af89e422 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java @@ -0,0 +1,24 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface FailEchoWithDetailsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.FailEchoWithDetailsResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java new file mode 100644 index 0000000000..82e6106608 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..8cf0368c63 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetBlurbRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java new file mode 100644 index 0000000000..2e5c7f0576 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java new file mode 100644 index 0000000000..8529a6b78d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetRoomRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java new file mode 100644 index 0000000000..8dbf20eb47 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequest.java @@ -0,0 +1,603 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..3444856fc6 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSequenceReportRequestOrBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java new file mode 100644 index 0000000000..1a8602adad --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequest.java @@ -0,0 +1,645 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java new file mode 100644 index 0000000000..631848993d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetSessionRequestOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java new file mode 100644 index 0000000000..78c299eddc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequest.java @@ -0,0 +1,609 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.GetStreamingSequenceReportRequest} */ +public final class GetStreamingSequenceReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + GetStreamingSequenceReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use GetStreamingSequenceReportRequest.newBuilder() to construct. + private GetStreamingSequenceReportRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetStreamingSequenceReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetStreamingSequenceReportRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetStreamingSequenceReportRequest( + 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_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.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.GetStreamingSequenceReportRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other = + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) 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.GetStreamingSequenceReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.GetStreamingSequenceReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.GetStreamingSequenceReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.GetStreamingSequenceReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest 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.GetStreamingSequenceReportRequest 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.GetStreamingSequenceReportRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + com.google.showcase.v1beta1.GetStreamingSequenceReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.class, + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.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_GetStreamingSequenceReportRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest build() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.GetStreamingSequenceReportRequest buildPartial() { + com.google.showcase.v1beta1.GetStreamingSequenceReportRequest result = + new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(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.GetStreamingSequenceReportRequest) { + return mergeFrom((com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.GetStreamingSequenceReportRequest other) { + if (other + == com.google.showcase.v1beta1.GetStreamingSequenceReportRequest.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.GetStreamingSequenceReportRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.GetStreamingSequenceReportRequest) + 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.GetStreamingSequenceReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + private static final com.google.showcase.v1beta1.GetStreamingSequenceReportRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.GetStreamingSequenceReportRequest(); + } + + public static com.google.showcase.v1beta1.GetStreamingSequenceReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStreamingSequenceReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetStreamingSequenceReportRequest(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.GetStreamingSequenceReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java new file mode 100644 index 0000000000..2f436b93a7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetStreamingSequenceReportRequestOrBuilder.java @@ -0,0 +1,43 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface GetStreamingSequenceReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.GetStreamingSequenceReportRequest) + 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java new file mode 100644 index 0000000000..0ffccfa9ce --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java new file mode 100644 index 0000000000..7555bcc95e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/GetUserRequestOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java new file mode 100644 index 0000000000..77da312fd8 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IdentityOuterClass.java @@ -0,0 +1,226 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/protobuf/empty.proto\032" + + " google/protobuf/field_mask.proto\032\037google/protobuf/timestamp.proto\"\204\003\n" + + "\004User\022\014\n" + + "\004name\030\001 \001(\t\022\031\n" + + "\014display_name\030\002 \001(\tB\003\340A\002\022\022\n" + + "\005email\030\003 \001(\tB\003\340A\002\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.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\014users/{user}B\006\n" + + "\004_ageB\016\n" + + "\014_height_feetB\013\n" + + "\t_nicknameB\027\n" + + "\025_enable_notifications\"@\n" + + "\021CreateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\"D\n" + + "\016GetUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A\036\n" + + "\034showcase.googleapis.com/User\340A\002\"q\n" + + "\021UpdateUserRequest\022+\n" + + "\004user\030\001 \001(\0132\035.google.showcase.v1beta1.User\022/\n" + + "\013update_mask\030\002 \001(\0132\032.google.protobuf.FieldMask\"G\n" + + "\021DeleteUserRequest\0222\n" + + "\004name\030\001 \001(\tB$\372A\036\n" + + "\034showcase.googleapis.com/User\340A\002\"9\n" + + "\020ListUsersRequest\022\021\n" + + "\tpage_size\030\001 \001(\005\022\022\n" + + "\n" + + "page_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" + + "\010Identity\022\363\001\n\n" + + "CreateUser\022*.google.showcase.v1beta1.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.height_feet\022y\n" + + "\007GetUser\022\'.google.showcase.v1beta1.GetUserRequest\032\035.google.showcase.v" + + "1beta1.User\"&\202\323\344\223\002\031\022\027/v1beta1/{name=users/*}\332A\004name\022\203\001\n\n" + + "UpdateUser\022*.google.showcase.v1beta1.UpdateUserRequest\032\035.google." + + "showcase.v1beta1.User\"*\202\323\344\223\002$2\034/v1beta1/{user.name=users/*}:\004user\022x\n\n" + + "DeleteUser\022*.google.showcase.v1beta1.DeleteUserRequ" + + "est\032\026.google.protobuf.Empty\"&\202\323\344\223\002\031*\027/v1beta1/{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\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcas" + + "e/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.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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java new file mode 100644 index 0000000000..1e4f2a52db --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Issue.java @@ -0,0 +1,1267 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java new file mode 100644 index 0000000000..ca34257b92 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/IssueOrBuilder.java @@ -0,0 +1,103 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java new file mode 100644 index 0000000000..431e4fdbbe --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java @@ -0,0 +1,963 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 who 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 who 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 who 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 who 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 who 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 who 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 who 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..609bdee635 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 who 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 who 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java new file mode 100644 index 0000000000..6efce8118e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponse.java @@ -0,0 +1,1178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..48fb48aa4d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java new file mode 100644 index 0000000000..308d153f79 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequest.java @@ -0,0 +1,759 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java new file mode 100644 index 0000000000..36d0587032 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsRequestOrBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java new file mode 100644 index 0000000000..ad0c941576 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponse.java @@ -0,0 +1,1178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java new file mode 100644 index 0000000000..f14ac868aa --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListRoomsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java new file mode 100644 index 0000000000..28c0395297 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequest.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java new file mode 100644 index 0000000000..ef4c9b52b0 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java new file mode 100644 index 0000000000..dfd32eb721 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponse.java @@ -0,0 +1,1166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java new file mode 100644 index 0000000000..d8475fb2cb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListSessionsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java new file mode 100644 index 0000000000..93b02387a1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java new file mode 100644 index 0000000000..451ba9e531 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java new file mode 100644 index 0000000000..57c616d2fc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponse.java @@ -0,0 +1,1162 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java new file mode 100644 index 0000000000..981c759a8c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListTestsResponseOrBuilder.java @@ -0,0 +1,108 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java new file mode 100644 index 0000000000..c38a00dc07 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequest.java @@ -0,0 +1,759 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java new file mode 100644 index 0000000000..bebb9a3b7b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersRequestOrBuilder.java @@ -0,0 +1,69 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java new file mode 100644 index 0000000000..b1dc9df720 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponse.java @@ -0,0 +1,1178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java new file mode 100644 index 0000000000..ddcf85b023 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListUsersResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java new file mode 100644 index 0000000000..5f48a7ca5a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/MessagingOuterClass.java @@ -0,0 +1,492 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java new file mode 100644 index 0000000000..982a20cb30 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponse.java @@ -0,0 +1,1042 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + 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< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + 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< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + 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< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + internalGetAlphabetized() { + if (alphabetized_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AlphabetizedDefaultEntryHolder.defaultEntry); + } + return alphabetized_; + } + + private com.google.protobuf.MapField< + java.lang.String, com.google.showcase.v1beta1.PagedExpandResponseList> + 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java new file mode 100644 index 0000000000..fadc9734cd --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyMappedResponseOrBuilder.java @@ -0,0 +1,132 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java new file mode 100644 index 0000000000..67b02877b7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequest.java @@ -0,0 +1,939 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java new file mode 100644 index 0000000000..c9e94d7c28 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandLegacyRequestOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java new file mode 100644 index 0000000000..e1f0478ab1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequest.java @@ -0,0 +1,925 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java new file mode 100644 index 0000000000..c111c66bb2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandRequestOrBuilder.java @@ -0,0 +1,90 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java new file mode 100644 index 0000000000..83103b1e30 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponse.java @@ -0,0 +1,1160 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java new file mode 100644 index 0000000000..4d2cbaa0ed --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseList.java @@ -0,0 +1,676 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java new file mode 100644 index 0000000000..ca8e53aab6 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseListOrBuilder.java @@ -0,0 +1,55 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java new file mode 100644 index 0000000000..9171114d4a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PagedExpandResponseOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java new file mode 100644 index 0000000000..b2e280ccf1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java @@ -0,0 +1,606 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * The custom error detail to be included in the error response from the
+ * FailEchoWithDetails method. Client libraries should be able to
+ * surface this custom error detail.
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ +public final class PoetryError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.PoetryError) + PoetryErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use PoetryError.newBuilder() to construct. + private PoetryError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PoetryError() { + poem_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PoetryError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PoetryError( + 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(); + + poem_ = 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_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + public static final int POEM_FIELD_NUMBER = 1; + private volatile java.lang.Object poem_; + + /** + * string poem = 1; + * + * @return The poem. + */ + @java.lang.Override + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + 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(); + poem_ = s; + return s; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = 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(poem_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, poem_); + } + 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(poem_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, poem_); + } + 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.PoetryError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.PoetryError other = (com.google.showcase.v1beta1.PoetryError) obj; + + if (!getPoem().equals(other.getPoem())) 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) + POEM_FIELD_NUMBER; + hash = (53 * hash) + getPoem().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError 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.PoetryError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError 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.PoetryError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.PoetryError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.PoetryError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.PoetryError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.PoetryError 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.PoetryError 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 custom error detail to be included in the error response from the
+   * FailEchoWithDetails method. Client libraries should be able to
+   * surface this custom error detail.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.PoetryError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.PoetryError) + com.google.showcase.v1beta1.PoetryErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.PoetryError.class, + com.google.showcase.v1beta1.PoetryError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.PoetryError.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(); + poem_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.EchoOuterClass + .internal_static_google_showcase_v1beta1_PoetryError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.PoetryError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError build() { + com.google.showcase.v1beta1.PoetryError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.PoetryError buildPartial() { + com.google.showcase.v1beta1.PoetryError result = + new com.google.showcase.v1beta1.PoetryError(this); + result.poem_ = poem_; + 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.PoetryError) { + return mergeFrom((com.google.showcase.v1beta1.PoetryError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.PoetryError other) { + if (other == com.google.showcase.v1beta1.PoetryError.getDefaultInstance()) return this; + if (!other.getPoem().isEmpty()) { + poem_ = other.poem_; + 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.PoetryError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.PoetryError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object poem_ = ""; + + /** + * string poem = 1; + * + * @return The poem. + */ + public java.lang.String getPoem() { + java.lang.Object ref = poem_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + poem_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + public com.google.protobuf.ByteString getPoemBytes() { + java.lang.Object ref = poem_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + poem_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string poem = 1; + * + * @param value The poem to set. + * @return This builder for chaining. + */ + public Builder setPoem(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + poem_ = value; + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @return This builder for chaining. + */ + public Builder clearPoem() { + + poem_ = getDefaultInstance().getPoem(); + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @param value The bytes for poem to set. + * @return This builder for chaining. + */ + public Builder setPoemBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + poem_ = 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.PoetryError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.PoetryError) + private static final com.google.showcase.v1beta1.PoetryError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.PoetryError(); + } + + public static com.google.showcase.v1beta1.PoetryError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PoetryError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PoetryError(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.PoetryError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java new file mode 100644 index 0000000000..a7ae660a46 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/echo.proto + +package com.google.showcase.v1beta1; + +public interface PoetryErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.PoetryError) + com.google.protobuf.MessageOrBuilder { + + /** + * string poem = 1; + * + * @return The poem. + */ + java.lang.String getPoem(); + + /** + * string poem = 1; + * + * @return The bytes for poem. + */ + com.google.protobuf.ByteString getPoemBytes(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java new file mode 100644 index 0000000000..86d11a20a2 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ProfileName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java new file mode 100644 index 0000000000..4135ea6b9f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequest.java @@ -0,0 +1,1660 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java new file mode 100644 index 0000000000..8fc2590475 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatRequestOrBuilder.java @@ -0,0 +1,179 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java new file mode 100644 index 0000000000..eeb18d60ec --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponse.java @@ -0,0 +1,830 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java new file mode 100644 index 0000000000..db14129a3e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RepeatResponseOrBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java new file mode 100644 index 0000000000..0001110e5a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java new file mode 100644 index 0000000000..63fed63d3b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionRequestOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java new file mode 100644 index 0000000000..b5285ddf67 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponse.java @@ -0,0 +1,1307 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java new file mode 100644 index 0000000000..c37784bc94 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ReportSessionResponseOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java new file mode 100644 index 0000000000..4571408339 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java @@ -0,0 +1,2154 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +package com.google.showcase.v1beta1; + +/** + * + * + *
+ * HTTP/JSON error representation as defined in
+ * https://google.aip.dev/193#http11json-representation,
+ * 
+ * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ +public final class RestError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError) + RestErrorOrBuilder { + private static final long serialVersionUID = 0L; + + // Use RestError.newBuilder() to construct. + private RestError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RestError() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RestError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RestError( + 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.RestError.Status.Builder subBuilder = null; + if (error_ != null) { + subBuilder = error_.toBuilder(); + } + error_ = + input.readMessage( + com.google.showcase.v1beta1.RestError.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.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + public interface StatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError.Status) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * The HTTP status code that corresponds to `google.rpc.Status.code`.
+     * 
+ * + * int32 code = 1; + * + * @return The code. + */ + int getCode(); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.message`.
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + java.lang.String getMessage(); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.message`.
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + com.google.protobuf.ByteString getMessageBytes(); + + /** + * + * + *
+     * This is the enum version for `google.rpc.Status.code`.
+     * 
+ * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + + /** + * + * + *
+     * This is the enum version for `google.rpc.Status.code`.
+     * 
+ * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + com.google.rpc.Code getStatus(); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsList(); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.Any getDetails(int index); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + int getDetailsCount(); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + java.util.List getDetailsOrBuilderList(); + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index); + } + + /** Protobuf type {@code google.showcase.v1beta1.RestError.Status} */ + public static final class Status extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.RestError.Status) + StatusOrBuilder { + private static final long serialVersionUID = 0L; + + // Use Status.newBuilder() to construct. + private Status(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Status() { + message_ = ""; + status_ = 0; + details_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Status(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Status( + 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: + { + code_ = input.readInt32(); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + message_ = s; + break; + } + case 32: + { + int rawValue = input.readEnum(); + + status_ = rawValue; + break; + } + case 42: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + details_.add( + input.readMessage(com.google.protobuf.Any.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)) { + details_ = java.util.Collections.unmodifiableList(details_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + + /** + * + * + *
+     * The HTTP status code that corresponds to `google.rpc.Status.code`.
+     * 
+ * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + public static final int MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object message_; + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.message`.
+     * 
+ * + * string message = 2; + * + * @return The message. + */ + @java.lang.Override + public java.lang.String getMessage() { + java.lang.Object ref = message_; + 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(); + message_ = s; + return s; + } + } + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.message`.
+     * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + @java.lang.Override + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 4; + private int status_; + + /** + * + * + *
+     * This is the enum version for `google.rpc.Status.code`.
+     * 
+ * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+     * This is the enum version for `google.rpc.Status.code`.
+     * 
+ * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + @SuppressWarnings("deprecation") + com.google.rpc.Code result = com.google.rpc.Code.valueOf(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + private java.util.List details_; + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsList() { + return details_; + } + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public java.util.List getDetailsOrBuilderList() { + return details_; + } + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public int getDetailsCount() { + return details_.size(); + } + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.Any getDetails(int index) { + return details_.get(index); + } + + /** + * + * + *
+     * This corresponds to `google.rpc.Status.details`.
+     * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + return details_.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 (code_ != 0) { + output.writeInt32(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + output.writeEnum(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + output.writeMessage(5, details_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, code_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(message_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_); + } + if (status_ != com.google.rpc.Code.OK.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, status_); + } + for (int i = 0; i < details_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, details_.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.RestError.Status)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError.Status other = + (com.google.showcase.v1beta1.RestError.Status) obj; + + if (getCode() != other.getCode()) return false; + if (!getMessage().equals(other.getMessage())) return false; + if (status_ != other.status_) return false; + if (!getDetailsList().equals(other.getDetailsList())) 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) + CODE_FIELD_NUMBER; + hash = (53 * hash) + getCode(); + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + if (getDetailsCount() > 0) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetailsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.RestError.Status parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.RestError.Status parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError.Status parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.RestError.Status parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.RestError.Status parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError.Status 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.RestError.Status 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.RestError.Status} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError.Status) + com.google.showcase.v1beta1.RestError.StatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.Status.class, + com.google.showcase.v1beta1.RestError.Status.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.Status.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getDetailsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + message_ = ""; + + status_ = 0; + + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + detailsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.Status.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status build() { + com.google.showcase.v1beta1.RestError.Status result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status buildPartial() { + com.google.showcase.v1beta1.RestError.Status result = + new com.google.showcase.v1beta1.RestError.Status(this); + int from_bitField0_ = bitField0_; + result.code_ = code_; + result.message_ = message_; + result.status_ = status_; + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.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.RestError.Status) { + return mergeFrom((com.google.showcase.v1beta1.RestError.Status) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError.Status other) { + if (other == com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) return this; + if (other.getCode() != 0) { + setCode(other.getCode()); + } + if (!other.getMessage().isEmpty()) { + message_ = other.message_; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000001); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + 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.RestError.Status parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RestError.Status) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private int code_; + + /** + * + * + *
+       * The HTTP status code that corresponds to `google.rpc.Status.code`.
+       * 
+ * + * int32 code = 1; + * + * @return The code. + */ + @java.lang.Override + public int getCode() { + return code_; + } + + /** + * + * + *
+       * The HTTP status code that corresponds to `google.rpc.Status.code`.
+       * 
+ * + * int32 code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(int value) { + + code_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * The HTTP status code that corresponds to `google.rpc.Status.code`.
+       * 
+ * + * int32 code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object message_ = ""; + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.message`.
+       * 
+ * + * string message = 2; + * + * @return The message. + */ + public java.lang.String getMessage() { + java.lang.Object ref = message_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + message_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.message`.
+       * 
+ * + * string message = 2; + * + * @return The bytes for message. + */ + public com.google.protobuf.ByteString getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + message_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.message`.
+       * 
+ * + * string message = 2; + * + * @param value The message to set. + * @return This builder for chaining. + */ + public Builder setMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + message_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.message`.
+       * 
+ * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + + message_ = getDefaultInstance().getMessage(); + onChanged(); + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.message`.
+       * 
+ * + * string message = 2; + * + * @param value The bytes for message to set. + * @return This builder for chaining. + */ + public Builder setMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + message_ = value; + onChanged(); + return this; + } + + private int status_ = 0; + + /** + * + * + *
+       * This is the enum version for `google.rpc.Status.code`.
+       * 
+ * + * .google.rpc.Code status = 4; + * + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override + public int getStatusValue() { + return status_; + } + + /** + * + * + *
+       * This is the enum version for `google.rpc.Status.code`.
+       * 
+ * + * .google.rpc.Code status = 4; + * + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + + status_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * This is the enum version for `google.rpc.Status.code`.
+       * 
+ * + * .google.rpc.Code status = 4; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + @SuppressWarnings("deprecation") + com.google.rpc.Code result = com.google.rpc.Code.valueOf(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + /** + * + * + *
+       * This is the enum version for `google.rpc.Status.code`.
+       * 
+ * + * .google.rpc.Code status = 4; + * + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(com.google.rpc.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + status_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * + * + *
+       * This is the enum version for `google.rpc.Status.code`.
+       * 
+ * + * .google.rpc.Code status = 4; + * + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + detailsBuilder_; + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsList() { + if (detailsBuilder_ == null) { + return java.util.Collections.unmodifiableList(details_); + } else { + return detailsBuilder_.getMessageList(); + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public int getDetailsCount() { + if (detailsBuilder_ == null) { + return details_.size(); + } else { + return detailsBuilder_.getCount(); + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any getDetails(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessage(index); + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.set(index, value); + onChanged(); + } else { + detailsBuilder_.setMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder setDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.set(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(value); + onChanged(); + } else { + detailsBuilder_.addMessage(value); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDetailsIsMutable(); + details_.add(index, value); + onChanged(); + } else { + detailsBuilder_.addMessage(index, value); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addDetails(int index, com.google.protobuf.Any.Builder builderForValue) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(index, builderForValue.build()); + onChanged(); + } else { + detailsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder addAllDetails(java.lang.Iterable values) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, details_); + onChanged(); + } else { + detailsBuilder_.addAllMessages(values); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + detailsBuilder_.clear(); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public Builder removeDetails(int index) { + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.remove(index); + onChanged(); + } else { + detailsBuilder_.remove(index); + } + return this; + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder getDetailsBuilder(int index) { + return getDetailsFieldBuilder().getBuilder(index); + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.AnyOrBuilder getDetailsOrBuilder(int index) { + if (detailsBuilder_ == null) { + return details_.get(index); + } else { + return detailsBuilder_.getMessageOrBuilder(index); + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsOrBuilderList() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(details_); + } + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder() { + return getDetailsFieldBuilder().addBuilder(com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public com.google.protobuf.Any.Builder addDetailsBuilder(int index) { + return getDetailsFieldBuilder() + .addBuilder(index, com.google.protobuf.Any.getDefaultInstance()); + } + + /** + * + * + *
+       * This corresponds to `google.rpc.Status.details`.
+       * 
+ * + * repeated .google.protobuf.Any details = 5; + */ + public java.util.List getDetailsBuilderList() { + return getDetailsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.protobuf.Any, + com.google.protobuf.Any.Builder, + com.google.protobuf.AnyOrBuilder>( + details_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + @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.RestError.Status) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError.Status) + private static final com.google.showcase.v1beta1.RestError.Status DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError.Status(); + } + + public static com.google.showcase.v1beta1.RestError.Status getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Status parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Status(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.RestError.Status getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int ERROR_FIELD_NUMBER = 1; + private com.google.showcase.v1beta1.RestError.Status error_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + @java.lang.Override + public boolean hasError() { + return error_ != null; + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.Status getError() { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + @java.lang.Override + public com.google.showcase.v1beta1.RestError.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 (error_ != null) { + output.writeMessage(1, getError()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (error_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, 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.RestError)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.RestError other = (com.google.showcase.v1beta1.RestError) obj; + + 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(); + 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.RestError parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError 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.RestError parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError 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.RestError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.RestError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.RestError parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.RestError parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.RestError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.RestError 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.RestError 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; + } + + /** + * + * + *
+   * HTTP/JSON error representation as defined in
+   * https://google.aip.dev/193#http11json-representation,
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.RestError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.RestError) + com.google.showcase.v1beta1.RestErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.RestError.class, + com.google.showcase.v1beta1.RestError.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.RestError.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 (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.RestErrorOuterClass + .internal_static_google_showcase_v1beta1_RestError_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError getDefaultInstanceForType() { + return com.google.showcase.v1beta1.RestError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError build() { + com.google.showcase.v1beta1.RestError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.RestError buildPartial() { + com.google.showcase.v1beta1.RestError result = + new com.google.showcase.v1beta1.RestError(this); + 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.RestError) { + return mergeFrom((com.google.showcase.v1beta1.RestError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.RestError other) { + if (other == com.google.showcase.v1beta1.RestError.getDefaultInstance()) return this; + 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.RestError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.RestError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.showcase.v1beta1.RestError.Status error_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + errorBuilder_; + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + public boolean hasError() { + return errorBuilder_ != null || error_ != null; + } + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + public com.google.showcase.v1beta1.RestError.Status getError() { + if (errorBuilder_ == null) { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } else { + return errorBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + error_ = value; + onChanged(); + } else { + errorBuilder_.setMessage(value); + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder setError(com.google.showcase.v1beta1.RestError.Status.Builder builderForValue) { + if (errorBuilder_ == null) { + error_ = builderForValue.build(); + onChanged(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (error_ != null) { + error_ = + com.google.showcase.v1beta1.RestError.Status.newBuilder(error_) + .mergeFrom(value) + .buildPartial(); + } else { + error_ = value; + } + onChanged(); + } else { + errorBuilder_.mergeFrom(value); + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder clearError() { + if (errorBuilder_ == null) { + error_ = null; + onChanged(); + } else { + error_ = null; + errorBuilder_ = null; + } + + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.Status.Builder getErrorBuilder() { + + onChanged(); + return getErrorFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder() { + if (errorBuilder_ != null) { + return errorBuilder_.getMessageOrBuilder(); + } else { + return error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.StatusOrBuilder> + getErrorFieldBuilder() { + if (errorBuilder_ == null) { + errorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.showcase.v1beta1.RestError.Status, + com.google.showcase.v1beta1.RestError.Status.Builder, + com.google.showcase.v1beta1.RestError.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.RestError) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.RestError) + private static final com.google.showcase.v1beta1.RestError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.RestError(); + } + + public static com.google.showcase.v1beta1.RestError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RestError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RestError(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.RestError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java new file mode 100644 index 0000000000..c5bd85534f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +package com.google.showcase.v1beta1; + +public interface RestErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.RestError) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return Whether the error field is set. + */ + boolean hasError(); + + /** + * .google.showcase.v1beta1.RestError.Status error = 1; + * + * @return The error. + */ + com.google.showcase.v1beta1.RestError.Status getError(); + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + com.google.showcase.v1beta1.RestError.StatusOrBuilder getErrorOrBuilder(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java new file mode 100644 index 0000000000..62a5a5cdc0 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java @@ -0,0 +1,87 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/rest_error.proto + +package com.google.showcase.v1beta1; + +public final class RestErrorOuterClass { + private RestErrorOuterClass() {} + + 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_RestError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_RestError_Status_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_RestError_Status_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/rest_er" + + "ror.proto\022\027google.showcase.v1beta1\032\031goog" + + "le/protobuf/any.proto\032\025google/rpc/code.p" + + "roto\"\267\001\n\tRestError\0228\n\005error\030\001 \001(\0132).goog" + + "le.showcase.v1beta1.RestError.Status\032p\n\006" + + "Status\022\014\n\004code\030\001 \001(\005\022\017\n\007message\030\002 \001(\t\022 \n" + + "\006status\030\004 \001(\0162\020.google.rpc.Code\022%\n\007detai" + + "ls\030\005 \003(\0132\024.google.protobuf.AnyBq\n\033com.go" + + "ogle.showcase.v1beta1P\001Z4github.com/goog" + + "leapis/gapic-showcase/server/genproto\352\002\031" + + "Google::Showcase::V1beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.AnyProto.getDescriptor(), + com.google.rpc.CodeProto.getDescriptor(), + }); + internal_static_google_showcase_v1beta1_RestError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_showcase_v1beta1_RestError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_descriptor, + new java.lang.String[] { + "Error", + }); + internal_static_google_showcase_v1beta1_RestError_Status_descriptor = + internal_static_google_showcase_v1beta1_RestError_descriptor.getNestedTypes().get(0); + internal_static_google_showcase_v1beta1_RestError_Status_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_showcase_v1beta1_RestError_Status_descriptor, + new java.lang.String[] { + "Code", "Message", "Status", "Details", + }); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.rpc.CodeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java new file mode 100644 index 0000000000..e01afc2b5d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Room.java @@ -0,0 +1,1623 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java new file mode 100644 index 0000000000..a3c3707242 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java new file mode 100644 index 0000000000..bd16570831 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RoomOrBuilder.java @@ -0,0 +1,183 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java new file mode 100644 index 0000000000..b564fe4b9e --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadata.java @@ -0,0 +1,740 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java new file mode 100644 index 0000000000..bb168ffb4f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsMetadataOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java new file mode 100644 index 0000000000..84459a3872 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequest.java @@ -0,0 +1,1157 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..c55a0f9e4a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsRequestOrBuilder.java @@ -0,0 +1,128 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java new file mode 100644 index 0000000000..1150887389 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponse.java @@ -0,0 +1,1179 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..90f1e1e1b4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SearchBlurbsResponseOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java new file mode 100644 index 0000000000..3735c00f79 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponse.java @@ -0,0 +1,754 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..658b06a1e5 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SendBlurbsResponseOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java new file mode 100644 index 0000000000..edc2abf0f5 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Sequence.java @@ -0,0 +1,2202 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java new file mode 100644 index 0000000000..a5317c10c4 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java new file mode 100644 index 0000000000..448b730da9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java new file mode 100644 index 0000000000..8767f3199f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceOuterClass.java @@ -0,0 +1,350 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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_StreamingSequence_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_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_CreateStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_CreateStreamingSequenceRequest_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_AttemptStreamingSequenceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_AttemptStreamingSequenceResponse_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; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_showcase_v1beta1_GetStreamingSequenceReportRequest_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}\"\312\002\n\021Str" + + "eamingSequence\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\017\n\007con" + + "tent\030\002 \001(\t\022F\n\tresponses\030\003 \003(\01323.google.s" + + "howcase.v1beta1.StreamingSequence.Respon" + + "se\032p\n\010Response\022\"\n\006status\030\001 \001(\0132\022.google." + + "rpc.Status\022(\n\005delay\030\002 \001(\0132\031.google.proto" + + "buf.Duration\022\026\n\016response_index\030\003 \001(\005:W\352A" + + "T\n)showcase.googleapis.com/StreamingSequ" + + "ence\022\'streamingSequences/{streaming_sequ" + + "ence}\"\322\003\n\027StreamingSequenceReport\022\021\n\004nam" + + "e\030\001 \001(\tB\003\340A\003\022J\n\010attempts\030\002 \003(\01328.google." + + "showcase.v1beta1.StreamingSequenceReport" + + ".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.Status:u\352Ar" + + "\n/showcase.googleapis.com/StreamingSeque" + + "nceReport\022?streamingSequences/{streaming" + + "_sequence}/streamingSequenceReport\"\233\003\n\016S" + + "equenceReport\022\021\n\004name\030\001 \001(\tB\003\340A\003\022A\n\010atte" + + "mpts\030\002 \003(\0132/.google.showcase.v1beta1.Seq" + + "uenceReport.Attempt\032\340\001\n\007Attempt\022\026\n\016attem" + + "pt_number\030\001 \001(\005\0224\n\020attempt_deadline\030\002 \001(" + + "\0132\032.google.protobuf.Timestamp\0221\n\rrespons" + + "e_time\030\003 \001(\0132\032.google.protobuf.Timestamp" + + "\0220\n\rattempt_delay\030\004 \001(\0132\031.google.protobu" + + "f.Duration\022\"\n\006status\030\005 \001(\0132\022.google.rpc." + + "Status:P\352AM\n&showcase.googleapis.com/Seq" + + "uenceReport\022#sequences/{sequence}/sequen" + + "ceReport\"L\n\025CreateSequenceRequest\0223\n\010seq" + + "uence\030\001 \001(\0132!.google.showcase.v1beta1.Se" + + "quence\"h\n\036CreateStreamingSequenceRequest" + + "\022F\n\022streaming_sequence\030\001 \001(\0132*.google.sh" + + "owcase.v1beta1.StreamingSequence\"P\n\026Atte" + + "mptSequenceRequest\0226\n\004name\030\001 \001(\tB(\372A\"\n s" + + "howcase.googleapis.com/Sequence\340A\002\"\200\001\n\037A" + + "ttemptStreamingSequenceRequest\022?\n\004name\030\001" + + " \001(\tB1\372A+\n)showcase.googleapis.com/Strea" + + "mingSequence\340A\002\022\034\n\017last_fail_index\030\002 \001(\005" + + "B\003\340A\001\"3\n AttemptStreamingSequenceRespons" + + "e\022\017\n\007content\030\001 \001(\t\"X\n\030GetSequenceReportR" + + "equest\022<\n\004name\030\001 \001(\tB.\372A(\n&showcase.goog" + + "leapis.com/SequenceReport\340A\002\"j\n!GetStrea" + + "mingSequenceReportRequest\022E\n\004name\030\001 \001(\tB" + + "7\372A1\n/showcase.googleapis.com/StreamingS" + + "equenceReport\340A\0022\360\010\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\314\001\n\027CreateSt" + + "reamingSequence\0227.google.showcase.v1beta" + + "1.CreateStreamingSequenceRequest\032*.googl" + + "e.showcase.v1beta1.StreamingSequence\"L\202\323" + + "\344\223\0021\"\033/v1beta1/streamingSequences:\022strea" + + "ming_sequence\332A\022streaming_sequence\022\252\001\n\021G" + + "etSequenceReport\0221.google.showcase.v1bet" + + "a1.GetSequenceReportRequest\032\'.google.sho" + + "wcase.v1beta1.SequenceReport\"9\202\323\344\223\002,\022*/v" + + "1beta1/{name=sequences/*/sequenceReport}" + + "\332A\004name\022\327\001\n\032GetStreamingSequenceReport\022:" + + ".google.showcase.v1beta1.GetStreamingSeq" + + "uenceReportRequest\0320.google.showcase.v1b" + + "eta1.StreamingSequenceReport\"K\202\323\344\223\002>\022 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java new file mode 100644 index 0000000000..8099990181 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java new file mode 100644 index 0000000000..c1b362d84b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceReportOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java new file mode 100644 index 0000000000..3e91b808df --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Session.java @@ -0,0 +1,973 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java new file mode 100644 index 0000000000..b081a0cbfc --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java new file mode 100644 index 0000000000..395bec0425 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SessionOrBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java new file mode 100644 index 0000000000..968c84bcb3 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Severity.java @@ -0,0 +1,137 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java new file mode 100644 index 0000000000..8d5621bdc7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequest.java @@ -0,0 +1,958 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java new file mode 100644 index 0000000000..12f8efe90a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsRequestOrBuilder.java @@ -0,0 +1,95 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java new file mode 100644 index 0000000000..8f7b1931ab --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponse.java @@ -0,0 +1,1071 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java new file mode 100644 index 0000000000..44652ad61d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamBlurbsResponseOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java new file mode 100644 index 0000000000..bc9352c6eb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequence.java @@ -0,0 +1,2512 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequence} */ +public final class StreamingSequence extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence) + StreamingSequenceOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamingSequence.newBuilder() to construct. + private StreamingSequence(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingSequence() { + name_ = ""; + content_ = ""; + responses_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingSequence(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingSequence( + 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(); + + content_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + responses_ = + new java.util.ArrayList< + com.google.showcase.v1beta1.StreamingSequence.Response>(); + mutable_bitField0_ |= 0x00000001; + } + responses_.add( + input.readMessage( + com.google.showcase.v1beta1.StreamingSequence.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_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + public interface ResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence.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(); + + /** + * + * + *
+     * The index that the status should be sent
+     * 
+ * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + int getResponseIndex(); + } + + /** + * + * + *
+   * A server response to an RPC Attempt in a sequence.
+   * 
+ * + * Protobuf type {@code google.showcase.v1beta1.StreamingSequence.Response} + */ + public static final class Response extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequence.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; + } + case 24: + { + responseIndex_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.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(); + } + + public static final int RESPONSE_INDEX_FIELD_NUMBER = 3; + private int responseIndex_; + + /** + * + * + *
+     * The index that the status should be sent
+     * 
+ * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + 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()); + } + if (responseIndex_ != 0) { + output.writeInt32(3, responseIndex_); + } + 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()); + } + if (responseIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, responseIndex_); + } + 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.StreamingSequence.Response)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence.Response other = + (com.google.showcase.v1beta1.StreamingSequence.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 (getResponseIndex() != other.getResponseIndex()) 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 = (37 * hash) + RESPONSE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getResponseIndex(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.StreamingSequence.Response parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.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.StreamingSequence.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.StreamingSequence.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.StreamingSequence.Response} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence.Response) + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.Response.class, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.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; + } + responseIndex_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_Response_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response build() { + com.google.showcase.v1beta1.StreamingSequence.Response result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.Response buildPartial() { + com.google.showcase.v1beta1.StreamingSequence.Response result = + new com.google.showcase.v1beta1.StreamingSequence.Response(this); + if (statusBuilder_ == null) { + result.status_ = status_; + } else { + result.status_ = statusBuilder_.build(); + } + if (delayBuilder_ == null) { + result.delay_ = delay_; + } else { + result.delay_ = delayBuilder_.build(); + } + result.responseIndex_ = responseIndex_; + 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.StreamingSequence.Response) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence.Response) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence.Response other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.Response.getDefaultInstance()) + return this; + if (other.hasStatus()) { + mergeStatus(other.getStatus()); + } + if (other.hasDelay()) { + mergeDelay(other.getDelay()); + } + if (other.getResponseIndex() != 0) { + setResponseIndex(other.getResponseIndex()); + } + 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.StreamingSequence.Response parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.StreamingSequence.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_; + } + + private int responseIndex_; + + /** + * + * + *
+       * The index that the status should be sent
+       * 
+ * + * int32 response_index = 3; + * + * @return The responseIndex. + */ + @java.lang.Override + public int getResponseIndex() { + return responseIndex_; + } + + /** + * + * + *
+       * The index that the status should be sent
+       * 
+ * + * int32 response_index = 3; + * + * @param value The responseIndex to set. + * @return This builder for chaining. + */ + public Builder setResponseIndex(int value) { + + responseIndex_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+       * The index that the status should be sent
+       * 
+ * + * int32 response_index = 3; + * + * @return This builder for chaining. + */ + public Builder clearResponseIndex() { + + responseIndex_ = 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.StreamingSequence.Response) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence.Response) + private static final com.google.showcase.v1beta1.StreamingSequence.Response DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence.Response(); + } + + public static com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.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 CONTENT_FIELD_NUMBER = 2; + private volatile java.lang.Object content_; + + /** + * + * + *
+   * The Content that the stream will send
+   * 
+ * + * string content = 2; + * + * @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 the stream will send
+   * 
+ * + * string content = 2; + * + * @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 RESPONSES_FIELD_NUMBER = 3; + 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.StreamingSequence.Response responses = 3; + */ + @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.StreamingSequence.Response responses = 3; + */ + @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.StreamingSequence.Response responses = 3; + */ + @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.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence.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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + output.writeMessage(3, 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(content_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + for (int i = 0; i < responses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, 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.StreamingSequence)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequence other = + (com.google.showcase.v1beta1.StreamingSequence) obj; + + if (!getName().equals(other.getName())) return false; + if (!getContent().equals(other.getContent())) 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(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().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.StreamingSequence parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.StreamingSequence parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.StreamingSequence parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequence parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.StreamingSequence parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.StreamingSequence parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequence 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.StreamingSequence 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.StreamingSequence} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequence) + com.google.showcase.v1beta1.StreamingSequenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequence.class, + com.google.showcase.v1beta1.StreamingSequence.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequence.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_ = ""; + + content_ = ""; + + 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_StreamingSequence_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence build() { + com.google.showcase.v1beta1.StreamingSequence result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequence buildPartial() { + com.google.showcase.v1beta1.StreamingSequence result = + new com.google.showcase.v1beta1.StreamingSequence(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.content_ = content_; + 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.StreamingSequence) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequence) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequence other) { + if (other == com.google.showcase.v1beta1.StreamingSequence.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + 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.StreamingSequence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.showcase.v1beta1.StreamingSequence) 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.lang.Object content_ = ""; + + /** + * + * + *
+     * The Content that the stream will send
+     * 
+ * + * string content = 2; + * + * @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 the stream will send
+     * 
+ * + * string content = 2; + * + * @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 the stream will send
+     * 
+ * + * string content = 2; + * + * @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 the stream will send
+     * 
+ * + * string content = 2; + * + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + + /** + * + * + *
+     * The Content that the stream will send
+     * 
+ * + * string content = 2; + * + * @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 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.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public Builder setResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public Builder addResponses(com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public Builder addResponses( + int index, com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder() { + return getResponsesFieldBuilder() + .addBuilder(com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public com.google.showcase.v1beta1.StreamingSequence.Response.Builder addResponsesBuilder( + int index) { + return getResponsesFieldBuilder() + .addBuilder( + index, com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + public java.util.List + getResponsesBuilderList() { + return getResponsesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder> + getResponsesFieldBuilder() { + if (responsesBuilder_ == null) { + responsesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequence.Response, + com.google.showcase.v1beta1.StreamingSequence.Response.Builder, + com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequence) + private static final com.google.showcase.v1beta1.StreamingSequence DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequence(); + } + + public static com.google.showcase.v1beta1.StreamingSequence getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingSequence(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.StreamingSequence getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java new file mode 100644 index 0000000000..ee58f2349c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceName.java @@ -0,0 +1,168 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 StreamingSequenceName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding("streamingSequences/{streaming_sequence}"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceName() { + streamingSequence = null; + } + + private StreamingSequenceName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, "StreamingSequenceName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_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 (StreamingSequenceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceName that = ((StreamingSequenceName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceName streamingSequenceName) { + this.streamingSequence = streamingSequenceName.streamingSequence; + } + + public StreamingSequenceName build() { + return new StreamingSequenceName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java new file mode 100644 index 0000000000..2c05ec00aa --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface StreamingSequenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequence) + 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 Content that the stream will send
+   * 
+ * + * string content = 2; + * + * @return The content. + */ + java.lang.String getContent(); + + /** + * + * + *
+   * The Content that the stream will send
+   * 
+ * + * string content = 2; + * + * @return The bytes for content. + */ + com.google.protobuf.ByteString getContentBytes(); + + /** + * + * + *
+   * Sequence of responses to return in order for each attempt. If empty, the
+   * default response is an immediate OK.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + 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.StreamingSequence.Response responses = 3; + */ + com.google.showcase.v1beta1.StreamingSequence.ResponseOrBuilder getResponsesOrBuilder(int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java new file mode 100644 index 0000000000..4e4a388dea --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReport.java @@ -0,0 +1,3005 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.StreamingSequenceReport} */ +public final class StreamingSequenceReport extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport) + StreamingSequenceReportOrBuilder { + private static final long serialVersionUID = 0L; + + // Use StreamingSequenceReport.newBuilder() to construct. + private StreamingSequenceReport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingSequenceReport() { + name_ = ""; + attempts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingSequenceReport(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StreamingSequenceReport( + 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< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt>(); + mutable_bitField0_ |= 0x00000001; + } + attempts_.add( + input.readMessage( + com.google.showcase.v1beta1.StreamingSequenceReport.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_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + public interface AttemptOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt} + */ + public static final class Attempt extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.StreamingSequenceReport.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_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other = + (com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.Attempt} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_Attempt_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.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_StreamingSequenceReport_Attempt_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt build() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt result = + new com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport.Attempt) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport.Attempt other) { + if (other + == com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport.Attempt) + private static final com.google.showcase.v1beta1.StreamingSequenceReport.Attempt + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport.Attempt(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsOrBuilderList() { + return attempts_; + } + + /** + * + * + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index) { + return attempts_.get(index); + } + + /** + * + * + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.StreamingSequenceReport other = + (com.google.showcase.v1beta1.StreamingSequenceReport) 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.StreamingSequenceReport parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.StreamingSequenceReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.StreamingSequenceReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.StreamingSequenceReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.StreamingSequenceReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport 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.StreamingSequenceReport 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.StreamingSequenceReport} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.StreamingSequenceReport) + com.google.showcase.v1beta1.StreamingSequenceReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.SequenceOuterClass + .internal_static_google_showcase_v1beta1_StreamingSequenceReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.StreamingSequenceReport.class, + com.google.showcase.v1beta1.StreamingSequenceReport.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.StreamingSequenceReport.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_StreamingSequenceReport_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstanceForType() { + return com.google.showcase.v1beta1.StreamingSequenceReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport build() { + com.google.showcase.v1beta1.StreamingSequenceReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.StreamingSequenceReport buildPartial() { + com.google.showcase.v1beta1.StreamingSequenceReport result = + new com.google.showcase.v1beta1.StreamingSequenceReport(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.StreamingSequenceReport) { + return mergeFrom((com.google.showcase.v1beta1.StreamingSequenceReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.StreamingSequenceReport other) { + if (other == com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.showcase.v1beta1.StreamingSequenceReport) 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.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + attemptsBuilder_; + + /** + * + * + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder setAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts(com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public Builder addAttempts( + int index, + com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List< + ? extends com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + 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.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder + addAttemptsBuilder() { + return getAttemptsFieldBuilder() + .addBuilder( + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder addAttemptsBuilder( + int index) { + return getAttemptsFieldBuilder() + .addBuilder( + index, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.getDefaultInstance()); + } + + /** + * + * + *
+     * The set of RPC attempts received by the server for a Sequence.
+     * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + public java.util.List + getAttemptsBuilderList() { + return getAttemptsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder> + getAttemptsFieldBuilder() { + if (attemptsBuilder_ == null) { + attemptsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt, + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt.Builder, + com.google.showcase.v1beta1.StreamingSequenceReport.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.StreamingSequenceReport) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.StreamingSequenceReport) + private static final com.google.showcase.v1beta1.StreamingSequenceReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.StreamingSequenceReport(); + } + + public static com.google.showcase.v1beta1.StreamingSequenceReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingSequenceReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StreamingSequenceReport(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.StreamingSequenceReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java new file mode 100644 index 0000000000..d3e5c33ade --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportName.java @@ -0,0 +1,170 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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 StreamingSequenceReportName implements ResourceName { + private static final PathTemplate STREAMING_SEQUENCE = + PathTemplate.createWithoutUrlEncoding( + "streamingSequences/{streaming_sequence}/streamingSequenceReport"); + private volatile Map fieldValuesMap; + private final String streamingSequence; + + @Deprecated + protected StreamingSequenceReportName() { + streamingSequence = null; + } + + private StreamingSequenceReportName(Builder builder) { + streamingSequence = Preconditions.checkNotNull(builder.getStreamingSequence()); + } + + public String getStreamingSequence() { + return streamingSequence; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static StreamingSequenceReportName of(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build(); + } + + public static String format(String streamingSequence) { + return newBuilder().setStreamingSequence(streamingSequence).build().toString(); + } + + public static StreamingSequenceReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + STREAMING_SEQUENCE.validatedMatch( + formattedString, + "StreamingSequenceReportName.parse: formattedString not in valid format"); + return of(matchMap.get("streaming_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 (StreamingSequenceReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return STREAMING_SEQUENCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (streamingSequence != null) { + fieldMapBuilder.put("streaming_sequence", streamingSequence); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return STREAMING_SEQUENCE.instantiate("streaming_sequence", streamingSequence); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + StreamingSequenceReportName that = ((StreamingSequenceReportName) o); + return Objects.equals(this.streamingSequence, that.streamingSequence); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(streamingSequence); + return h; + } + + /** Builder for streamingSequences/{streaming_sequence}/streamingSequenceReport. */ + public static class Builder { + private String streamingSequence; + + protected Builder() {} + + public String getStreamingSequence() { + return streamingSequence; + } + + public Builder setStreamingSequence(String streamingSequence) { + this.streamingSequence = streamingSequence; + return this; + } + + private Builder(StreamingSequenceReportName streamingSequenceReportName) { + this.streamingSequence = streamingSequenceReportName.streamingSequence; + } + + public StreamingSequenceReportName build() { + return new StreamingSequenceReportName(this); + } + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java new file mode 100644 index 0000000000..0fa913ae50 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/StreamingSequenceReportOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: schema/google/showcase/v1beta1/sequence.proto + +package com.google.showcase.v1beta1; + +public interface StreamingSequenceReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.StreamingSequenceReport) + 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.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List getAttemptsList(); + + /** + * + * + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.Attempt getAttempts(int index); + + /** + * + * + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + int getAttemptsCount(); + + /** + * + * + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + java.util.List + getAttemptsOrBuilderList(); + + /** + * + * + *
+   * The set of RPC attempts received by the server for a Sequence.
+   * 
+ * + * repeated .google.showcase.v1beta1.StreamingSequenceReport.Attempt attempts = 2; + */ + com.google.showcase.v1beta1.StreamingSequenceReport.AttemptOrBuilder getAttemptsOrBuilder( + int index); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java new file mode 100644 index 0000000000..0df6475834 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/Test.java @@ -0,0 +1,4374 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 + 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< + com.google.showcase.v1beta1.Test.Blueprint.Invocation>(); + 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< + ? extends com.google.showcase.v1beta1.Test.Blueprint.InvocationOrBuilder> + 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java new file mode 100644 index 0000000000..276698030f --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestName.java @@ -0,0 +1,191 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java new file mode 100644 index 0000000000..a0cc89f870 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestOrBuilder.java @@ -0,0 +1,178 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java new file mode 100644 index 0000000000..e130234a14 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRun.java @@ -0,0 +1,936 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java new file mode 100644 index 0000000000..ed31c3c1c9 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestRunOrBuilder.java @@ -0,0 +1,92 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java new file mode 100644 index 0000000000..ac16d6e6ab --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/TestingOuterClass.java @@ -0,0 +1,377 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java new file mode 100644 index 0000000000..51af718756 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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 (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 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.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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java new file mode 100644 index 0000000000..1569bb6ba6 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java new file mode 100644 index 0000000000..0490400d1a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java new file mode 100644 index 0000000000..8b24d08224 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateRoomRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java new file mode 100644 index 0000000000..05cd45fc20 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequest.java @@ -0,0 +1,1036 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java new file mode 100644 index 0000000000..18fb3437d8 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateUserRequestOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java new file mode 100644 index 0000000000..4f7a5cbde7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/User.java @@ -0,0 +1,2295 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java new file mode 100644 index 0000000000..0195b1062d --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserName.java @@ -0,0 +1,166 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java new file mode 100644 index 0000000000..b3efd40700 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UserOrBuilder.java @@ -0,0 +1,310 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java new file mode 100644 index 0000000000..141314a96b --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequest.java @@ -0,0 +1,968 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java new file mode 100644 index 0000000000..12a4c76ca0 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java new file mode 100644 index 0000000000..38cabe8b19 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponse.java @@ -0,0 +1,722 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java new file mode 100644 index 0000000000..669a7abcbd --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/VerifyTestResponseOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java new file mode 100644 index 0000000000..f319d17f49 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadata.java @@ -0,0 +1,737 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java new file mode 100644 index 0000000000..7c4cbb844c --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitMetadataOrBuilder.java @@ -0,0 +1,62 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java new file mode 100644 index 0000000000..ee5df9cb45 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequest.java @@ -0,0 +1,1867 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java new file mode 100644 index 0000000000..73e72c4ebb --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitRequestOrBuilder.java @@ -0,0 +1,180 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java new file mode 100644 index 0000000000..a644f0d3af --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponse.java @@ -0,0 +1,644 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java new file mode 100644 index 0000000000..afc03cac94 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/WaitResponseOrBuilder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: 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(); +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto new file mode 100644 index 0000000000..4e8cba6b25 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto @@ -0,0 +1,269 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// 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. +service Compliance { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // This method echoes the ComplianceData request. This method exercises + // sending the entire request object in the REST body. + rpc RepeatDataBody(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:body" + body: "*" + }; + } + + // 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. + rpc RepeatDataBodyInfo(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:bodyinfo" + body: "info" + }; + } + + // This method echoes the ComplianceData request. This method exercises + // sending all request fields as query parameters. + rpc RepeatDataQuery(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat:query" + }; + } + + // 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. + rpc RepeatDataSimplePath(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string}/{info.f_int32}/{info.f_double}/{info.f_bool}/{info.f_kingdom}:simplepath" + }; + } + + // Same as RepeatDataSimplePath, but with a path resource. + rpc RepeatDataPathResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresource" + additional_bindings { + get: "/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/bool/{info.f_bool}:childfirstpathresource" + } + }; + } + + // Same as RepeatDataSimplePath, but with a trailing resource. + rpc RepeatDataPathTrailingResource(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/**}:pathtrailingresource" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PUT method. + rpc RepeatDataBodyPut(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + put: "/v1beta1/repeat:bodyput" + body: "*" + }; + } + + // This method echoes the ComplianceData request, using the HTTP PATCH method. + rpc RepeatDataBodyPatch(RepeatRequest) returns (RepeatResponse) { + option (google.api.http) = { + patch: "/v1beta1/repeat:bodypatch" + body: "*" + }; + } + + // 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 values 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. + rpc GetEnum(EnumRequest) returns (EnumResponse) { + option (google.api.http) = { + get: "/v1beta1/compliance/enum" + }; + } + + // 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. + rpc VerifyEnum(EnumResponse) returns (EnumResponse) { + option (google.api.http) = { + post: "/v1beta1/compliance/enum" + }; + } + +} + +message RepeatRequest { + string name = 1; + ComplianceData info = 2; + + // 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; + + // The URI template this request is expected to be bound to server-side. + optional string intended_binding_uri = 10; + + // Some top level fields, to test that these are encoded correctly + // in query params. + int32 f_int32 = 4; + int64 f_int64 = 5; + double f_double = 6; + + optional int32 p_int32 = 7; + optional int64 p_int64 = 8; + optional double p_double = 9; +} + +message RepeatResponse { + RepeatRequest request = 1; + + // The URI template the request was bound to server-side. + string binding_uri = 2; +} + +// ComplianceSuite contains a set of requests that microgenerators should issue +// over REST to the Compliance service to test their gRPC-to-REST transcoding +// implementation. +message ComplianceSuite { + repeated ComplianceGroup group = 1; +} + +// ComplianceGroups encapsulates a group of RPC requests to the Compliance +// server: one request for each combination of elements of `rpcs` and of +// `requests`. +message ComplianceGroup { + string name = 1; + repeated string rpcs = 2; + repeated RepeatRequest requests = 3; +} + +// ComplianceData is a message used for testing REST transcoding of +// different data types. +message ComplianceData { + enum LifeKingdom { + LIFE_KINGDOM_UNSPECIFIED = 0; + ARCHAEBACTERIA = 1; + EUBACTERIA = 2; + PROTISTA = 3; + FUNGI = 4; + PLANTAE = 5; + ANIMALIA = 6; +} + // scalar types + + string f_string = 1; + + int32 f_int32 = 2; + sint32 f_sint32 = 3; + sfixed32 f_sfixed32 = 4; + + uint32 f_uint32 = 5; + fixed32 f_fixed32 = 6; + + int64 f_int64 = 7; + sint64 f_sint64 = 8; + sfixed64 f_sfixed64 = 9; + + uint64 f_uint64 = 10; + fixed64 f_fixed64 = 11; + + double f_double = 12; + float f_float = 13; + + bool f_bool = 14; + + bytes f_bytes = 15; + + LifeKingdom f_kingdom = 22; + + ComplianceDataChild f_child = 16; + + // optional fields + + optional string p_string = 17; + optional int32 p_int32 = 18; + optional double p_double = 19; + optional bool p_bool = 20; + optional LifeKingdom p_kingdom = 23; + optional ComplianceDataChild p_child = 21; +} + +message ComplianceDataChild { + string f_string = 1; + float f_float = 2; + double f_double = 3; + bool f_bool = 4; + Continent f_continent = 11; + ComplianceDataGrandchild f_child = 5; + + optional string p_string = 6; + optional float p_float = 7; + optional double p_double = 8; + optional bool p_bool = 9; + Continent p_continent = 12; + optional ComplianceDataGrandchild p_child = 10; +} + +message ComplianceDataGrandchild { + string f_string = 1; + double f_double = 2; + bool f_bool = 3; +} + +enum Continent { + CONTINENT_UNSPECIFIED = 0; + AFRICA = 1; + AMERICA = 2; + ANTARTICA = 3; + AUSTRALIA = 4; + EUROPE = 5; +} + + +message EnumRequest { + // Whether the client is requesting a new, unknown enum value or a known enum value already declared in this proto file. + bool unknown_enum = 1; +} + +message EnumResponse { + // The original request for a known or unknown enum from the server. + EnumRequest request = 1; + + // The actual enum the server provided. + Continent continent = 2; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto new file mode 100644 index 0000000000..55b7ab578a --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto @@ -0,0 +1,424 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/routing.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// 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. +service Echo { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + // See https://github.com/aip-dev/google.aip.dev/pull/1331 + option (google.api.api_version) = "v1_20240408"; + + // This method simply echoes the request. This method showcases unary RPCs. + rpc Echo(EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:echo" + body: "*" + }; + option (google.api.routing) = { + routing_parameters{ + field: "header" + } + routing_parameters{ + field: "header" + path_template: "{routing_id=**}" + } + routing_parameters{ + field: "header" + path_template: "{table_name=regions/*/zones/*/**}" + } + routing_parameters{ + field: "header" + path_template: "{super_id=projects/*}/**" + } + routing_parameters{ + field: "header" + path_template: "{table_name=projects/*/instances/*/**}" + } + routing_parameters{ + field: "header" + path_template: "projects/*/{instance_id=instances/*}/**" + } + routing_parameters{ + field: "other_header" + path_template: "{baz=**}" + } + routing_parameters{ + field: "other_header" + path_template: "{qux=projects/*}/**" + } + }; + } + + // This method returns error details in a repeated "google.protobuf.Any" + // field. This method showcases handling errors thus encoded, particularly + // over REST transport. Note that GAPICs only allow the type + // "google.protobuf.Any" for field paths ending in "error.details", and, at + // run-time, the actual types for these fields must be one of the types in + // google/rpc/error_details.proto. + rpc EchoErrorDetails(EchoErrorDetailsRequest) returns (EchoErrorDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:error-details" + body: "*" + }; + } + + // This method always fails with a gRPC "Aborted" error status that contains + // multiple error details. These include one instance of each of the standard + // ones in error_details.proto + // (https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto) + // plus a custom, Showcase-defined PoetryError. The intent of this RPC is to + // verify that GAPICs can process these various error details and surface them + // to the user in an idiomatic form. + rpc FailEchoWithDetails(FailEchoWithDetailsRequest) returns (FailEchoWithDetailsResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:failWithDetails" + body: "*" + }; + } + + // This method splits the given content into words and will pass each word back + // through the stream. This method showcases server-side streaming RPCs. + rpc Expand(ExpandRequest) returns (stream EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:expand" + body: "*" + }; + // TODO(landrito): change this to be `fields: ["content", "error"]` once + // github.com/dcodeIO/protobuf.js/issues/1094 has been resolved. + option (google.api.method_signature) = "content,error"; + } + + // 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. + rpc Collect(stream EchoRequest) returns (EchoResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:collect" + body: "*" + }; + } + + // This method, upon receiving a request on the stream, will pass the same + // content back on the stream. This method showcases bidirectional + // streaming RPCs. + rpc Chat(stream EchoRequest) returns (stream EchoResponse); + + // 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. + rpc PagedExpand(PagedExpandRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpand" + body: "*" + }; + } + + // 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. + rpc PagedExpandLegacy(PagedExpandLegacyRequest) returns (PagedExpandResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacy" + body: "*" + }; + } + + // 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. + rpc PagedExpandLegacyMapped(PagedExpandRequest) returns (PagedExpandLegacyMappedResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:pagedExpandLegacyMapped" + body: "*" + }; + } + + // This method will wait for the requested amount of time and then return. + // This method showcases how a client handles a request timeout. + rpc Wait(WaitRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/echo:wait" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "WaitResponse" + metadata_type: "WaitMetadata" + }; + } + + // 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. + rpc Block(BlockRequest) returns (BlockResponse) { + option (google.api.http) = { + post: "/v1beta1/echo:block" + body: "*" + }; + }; +} + +// A severity enum used to test enum capabilities in GAPIC surfaces. +enum Severity { + UNNECESSARY = 0; + NECESSARY = 1; + URGENT = 2; + CRITICAL = 3; +} + + +// 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. +message EchoRequest { + oneof response { + // The content to be echoed by the server. + string content = 1; + + // The error to be thrown by the server. + google.rpc.Status error = 2; + } + + // The severity to be echoed by the server. + Severity severity = 3; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string header = 4; + + // Optional. This field can be set to test the routing annotation on the Echo method. + string other_header = 5; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + string request_id = 7 [ + (google.api.field_info).format = UUID4 + ]; + + // To facilitate testing of https://google.aip.dev/client-libraries/4235 + optional string other_request_id = 8 [ + (google.api.field_info).format = UUID4 + ]; +} + +// The response message for the Echo methods. +message EchoResponse { + // The content specified in the request. + string content = 1; + + // The severity specified in the request. + Severity severity = 2; + + // The request ID specified or autopopulated in the request. + string request_id = 3; + + // The other request ID specified or autopopulated in the request. + string other_request_id = 4; +} + +// The request message used for the EchoErrorDetails method. +message EchoErrorDetailsRequest { + // Content to return in a singular `*.error.details` field of type + // `google.protobuf.Any` + string single_detail_text = 1; + + // Content to return in a repeated `*.error.details` field of type + // `google.protobuf.Any` + repeated string multi_detail_text = 2; +} + +// The response message used for the EchoErrorDetails method. +message EchoErrorDetailsResponse { + + message SingleDetail { + ErrorWithSingleDetail error = 1; + } + + message MultipleDetails { + ErrorWithMultipleDetails error = 1; + } + + SingleDetail single_detail = 1; + MultipleDetails multiple_details = 2; +} + +message ErrorWithSingleDetail { + google.protobuf.Any details = 1; +} + +message ErrorWithMultipleDetails { + repeated google.protobuf.Any details = 1; +} + +// The custom error detail to be included in the error response from the +// FailEchoWithDetails method. Client libraries should be able to +// surface this custom error detail. +message PoetryError { + string poem = 1; +} + +// The request message used for the FailEchoWithDetails method. +message FailEchoWithDetailsRequest { + // Optional message to echo back in the PoetryError. If empty, a value will be + // provided. + string message = 1; +} + +// The response message declared (but never used) for the FailEchoWithDetails +// method. +message FailEchoWithDetailsResponse {} + +// The request message for the Expand method. +message ExpandRequest { + // The content that will be split into words and returned on the stream. + string content = 1; + + // The error that is thrown after all words are sent on the stream. + google.rpc.Status error = 2; + + //The wait time between each server streaming messages + google.protobuf.Duration stream_wait_time = 3; +} + +// The request for the PagedExpand method. +message PagedExpandRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // The number of words to returned in each page. + int32 page_size = 2; + + // The position of the page to be returned. + string page_token = 3; +} + +// 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. +message PagedExpandLegacyRequest { + // The string to expand. + string content = 1 [(google.api.field_behavior) = REQUIRED]; + + // 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; + + // The position of the page to be returned. + string page_token = 3; +} + +// The response for the PagedExpand method. +message PagedExpandResponse { + // The words that were expanded. + repeated EchoResponse responses = 1; + + // The next page token. + string next_page_token = 2; +} + +// A list of words. +message PagedExpandResponseList { + repeated string words = 1; +} + +message PagedExpandLegacyMappedResponse { + // 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 alphabetized = 1; + + // The next page token. + string next_page_token = 2; +} + +// The request for Wait method. +message WaitRequest { + oneof end { + // The time that this operation will complete. + google.protobuf.Timestamp end_time = 1; + + // The duration of this operation. + google.protobuf.Duration ttl = 4; + } + + oneof response { + // 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; + + // The response to be returned on operation completion. + WaitResponse success = 3; + } +} + +// The result of the Wait operation. +message WaitResponse { + // This content of the result. + string content = 1; +} + +// The metadata for Wait operation. +message WaitMetadata { + // The time that this operation will complete. + google.protobuf.Timestamp end_time =1; +} + +// The request for Block method. +message BlockRequest { + // The amount of time to block before returning a response. + google.protobuf.Duration response_delay = 1; + + oneof response { + // 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; + + // The response to be returned that will signify successful method call. + BlockResponse success = 3; + } +} + +// The response for Block method. +message BlockResponse { + // This content can contain anything, the server will not depend on a value + // here. + string content = 1; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto new file mode 100644 index 0000000000..569c604d78 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/identity.proto @@ -0,0 +1,186 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A simple identity service. +service Identity { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a user. + rpc CreateUser(CreateUserRequest) returns (User) { + option (google.api.http) = { + post: "/v1beta1/users" + body: "*" + }; + option (google.api.method_signature) = "user.display_name,user.email"; + option (google.api.method_signature) = + "user.display_name,user.email,user.age,user.nickname,user.enable_notifications,user.height_feet"; + } + + // Retrieves the User with the given uri. + rpc GetUser(GetUserRequest) returns (User) { + option (google.api.http) = { + get: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a user. + rpc UpdateUser(UpdateUserRequest) returns (User) { + option (google.api.http) = { + patch: "/v1beta1/{user.name=users/*}" + body: "user" + }; + } + + // Deletes a user, their profile, and all of their authored messages. + rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=users/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all users. + rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { + option (google.api.http) = { + get: "/v1beta1/users" + }; + } +} + +// A user. +message User { + option (google.api.resource) = { + type: "showcase.googleapis.com/User" + pattern: "users/{user}" + }; + + // The resource name of the user. + string name = 1; + + // The display_name of the user. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The email address of the user. + string email = 3 [(google.api.field_behavior) = REQUIRED]; + + // The timestamp at which the user was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the user was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The age of the user in years. + optional int32 age = 6; + + // The height of the user in feet. + optional double height_feet = 7; + + // 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; + + // 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; +} + +// The request message for the google.showcase.v1beta1.Identity\CreateUser +// method. +message CreateUserRequest { + // The user to create. + User user = 1; +} + +// The request message for the google.showcase.v1beta1.Identity\GetUser +// method. +message GetUserRequest { + // The resource name of the requested user. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\UpdateUser +// method. +message UpdateUserRequest { + // The user to update. + User user = 1; + + // 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; +} + +// The request message for the google.showcase.v1beta1.Identity\DeleteUser +// method. +message DeleteUserRequest { + // The resource name of the user to delete. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersRequest { + // 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; + + // 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; +} + +// The response message for the google.showcase.v1beta1.Identity\ListUsers +// method. +message ListUsersResponse { + // The list of users. + repeated User users = 1; + + // 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; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto new file mode 100644 index 0000000000..330dc8c9e7 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto @@ -0,0 +1,520 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/error_details.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// 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. +service Messaging { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a room. + rpc CreateRoom(CreateRoomRequest) returns (Room) { + option (google.api.http) = { + post: "/v1beta1/rooms" + body: "*" + }; + option (google.api.method_signature) = "room.display_name,room.description"; + } + + // Retrieves the Room with the given resource name. + rpc GetRoom(GetRoomRequest) returns (Room) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a room. + rpc UpdateRoom(UpdateRoomRequest) returns (Room) { + option (google.api.http) = { + patch: "/v1beta1/{room.name=rooms/*}" + body: "room" + }; + } + + // Deletes a room and all of its blurbs. + rpc DeleteRoom(DeleteRoomRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all chat rooms. + rpc ListRooms(ListRoomsRequest) returns (ListRoomsResponse) { + option (google.api.http) = { + get: "/v1beta1/rooms" + }; + } + + // 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. + rpc CreateBlurb(CreateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs" + body: "*" + } + }; + option (google.api.method_signature) = "parent,blurb.user,blurb.text"; + option (google.api.method_signature) = "parent,blurb.user,blurb.image"; + } + + // Retrieves the Blurb with the given resource name. + rpc GetBlurb(GetBlurbRequest) returns (Blurb) { + option (google.api.http) = { + get: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { get: "/v1beta1/{name=users/*/profile/blurbs/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Updates a blurb. + rpc UpdateBlurb(UpdateBlurbRequest) returns (Blurb) { + option (google.api.http) = { + patch: "/v1beta1/{blurb.name=rooms/*/blurbs/*}" + body: "blurb" + additional_bindings: { + patch: "/v1beta1/{blurb.name=users/*/profile/blurbs/*}" + body: "blurb" + } + }; + } + + // Deletes a blurb. + rpc DeleteBlurb(DeleteBlurbRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=rooms/*/blurbs/*}" + additional_bindings: { + delete: "/v1beta1/{name=users/*/profile/blurbs/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists blurbs for a specific chat room or user profile depending on the + // parent resource name. + rpc ListBlurbs(ListBlurbsRequest) returns (ListBlurbsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=rooms/*}/blurbs" + additional_bindings: { get: "/v1beta1/{parent=users/*/profile}/blurbs" } + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc SearchBlurbs(SearchBlurbsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:search" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:search" + } + }; + option (google.longrunning.operation_info) = { + response_type: "SearchBlurbsResponse" + metadata_type: "SearchBlurbsMetadata" + }; + option (google.api.method_signature) = "parent,query"; + } + + // This returns a stream that emits the blurbs that are created for a + // particular chat room or user profile. + rpc StreamBlurbs(StreamBlurbsRequest) returns (stream StreamBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=rooms/*}/blurbs:stream" + body: "*" + additional_bindings: { + post: "/v1beta1/{name=users/*/profile}/blurbs:stream" + body: "*" + } + }; + } + + // This is a stream to create multiple blurbs. If an invalid blurb is + // requested to be created, the stream will close with an error. + rpc SendBlurbs(stream CreateBlurbRequest) returns (SendBlurbsResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=rooms/*}/blurbs:send" + body: "*" + additional_bindings: { + post: "/v1beta1/{parent=users/*/profile}/blurbs:send" + body: "*" + } + }; + } + + // 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. + rpc Connect(stream ConnectRequest) returns (stream StreamBlurbsResponse); +} + +// A chat room. +message Room { + option (google.api.resource) = { + type: "showcase.googleapis.com/Room" + pattern: "rooms/{room}" + }; + + // The resource name of the chat room. + string name = 1; + + // The human readable name of the chat room. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // The description of the chat room. + string description = 3; + + // The timestamp at which the room was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the room was updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateRoom +// method. +message CreateRoomRequest { + // The room to create. + Room room = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetRoom +// method. +message GetRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateRoom +// method. +message UpdateRoomRequest { + // The room to update. + Room room = 1; + + // 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; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteRoom +// method. +message DeleteRoomRequest { + // The resource name of the requested room. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Room", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsRequest { + // 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; + + // 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; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListRooms +// method. +message ListRoomsResponse { + // The list of rooms. + repeated Room rooms = 1; + + // 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; +} + +// This protocol buffer message represents a blurb sent to a chat room or +// posted on a user profile. +message Blurb { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blurb" + pattern: "users/{user}/profile/blurbs/legacy/{legacy_user}~{blurb}" + pattern: "users/{user}/profile/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/{blurb}" + pattern: "rooms/{room}/blurbs/legacy/{legacy_room}.{blurb}" + }; + + // The resource name of the chat room. + string name = 1; + + // The resource name of the blurb's author. + string user = 2 [ + (google.api.resource_reference).type = "showcase.googleapis.com/User", + (google.api.field_behavior) = REQUIRED + ]; + + oneof content { + // The textual content of this blurb. + string text = 3; + + // The image content of this blurb. + bytes image = 4; + } + + // The timestamp at which the blurb was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The latest timestamp at which the blurb was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // (-- aip.dev/not-precedent: This is designed for testing non-slash + // resource patterns. Ordinarily, non-slash separators are discouraged. + // --) + oneof legacy_id { + // 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; + + // 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; + } +} + +// The request message for the google.showcase.v1beta1.Messaging\CreateBlurb +// method. +message CreateBlurbRequest { + // The resource name of the chat room or user profile that this blurb will + // be tied to. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The blurb to create. + Blurb blurb = 2; +} + +// The request message for the google.showcase.v1beta1.Messaging\GetBlurb +// method. +message GetBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\UpdateBlurb +// method. +message UpdateBlurbRequest { + // The blurb to update. + Blurb blurb = 1; + + // 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; +} + +// The request message for the google.showcase.v1beta1.Messaging\DeleteBlurb +// method. +message DeleteBlurbRequest { + // The resource name of the requested blurb. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; +} + +// The request message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsRequest { + // The resource name of the requested room or profile who blurbs to list. + string parent = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // 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; + + // 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; +} + +// The response message for the google.showcase.v1beta1.Messaging\ListBlurbs +// method. +message ListBlurbsResponse { + // The list of blurbs. + repeated Blurb blurbs = 1; + + // 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; +} + +// The request message for the google.showcase.v1beta1.Messaging\SearchBlurbs +// method. +message SearchBlurbsRequest { + // 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]; + + // The rooms or profiles to search. If unset, `SearchBlurbs` will search all + // rooms and all profiles. + string parent = 2 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + + // 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; + + // 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; +} + +// The operation metadata message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsMetadata { + // This signals to the client when to next poll for response. + google.rpc.RetryInfo retry_info = 1; +} + +// The operation response message for the +// google.showcase.v1beta1.Messaging\SearchBlurbs method. +message SearchBlurbsResponse { + // Blurbs that matched the search query. + repeated Blurb blurbs = 1; + + // 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; +} + +// The request message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsRequest { + // The resource name of a chat room or user profile whose blurbs to stream. + string name = 1 [ + (google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb", + (google.api.field_behavior) = REQUIRED + ]; + + // The time at which this stream will close. + google.protobuf.Timestamp expire_time = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The response message for the google.showcase.v1beta1.Messaging\StreamBlurbs +// method. +message StreamBlurbsResponse { + // The blurb that was either created, updated, or deleted. + Blurb blurb = 1; + + // The action that triggered the blurb to be returned. + enum Action { + ACTION_UNSPECIFIED = 0; + + // Specifies that the blurb was created. + CREATE = 1; + + // Specifies that the blurb was updated. + UPDATE = 2; + + // Specifies that the blurb was deleted. + DELETE = 3; + } + + // The action that triggered the blurb to be returned. + Action action = 2; +} + +// The response message for the google.showcase.v1beta1.Messaging\SendBlurbs +// method. +message SendBlurbsResponse { + // The names of successful blurb creations. + repeated string names = 1; +} + +// The request message for the google.showcase.v1beta1.Messaging\Connect +// method. +message ConnectRequest { + message ConnectConfig { + // The room or profile to follow and create messages for. + string parent = 1 [(google.api.resource_reference).child_type = + "showcase.googleapis.com/Blurb"]; + } + + oneof request { + // Provides information that specifies how to process subsequent requests. + // The first `ConnectRequest` message must contain a `config` message. + ConnectConfig config = 1; + + // The blurb to be created. + Blurb blurb = 2; + } +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto new file mode 100644 index 0000000000..0b4e299597 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto @@ -0,0 +1,42 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/protobuf/any.proto"; +import "google/rpc/code.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// HTTP/JSON error representation as defined in +// https://google.aip.dev/193#http11json-representation, +message RestError { + message Status { + // The HTTP status code that corresponds to `google.rpc.Status.code`. + int32 code = 1; + // This corresponds to `google.rpc.Status.message`. + string message = 2; + // This is the enum version for `google.rpc.Status.code`. + google.rpc.Code status = 4; + // This corresponds to `google.rpc.Status.details`. + repeated google.protobuf.Any details = 5; + } + + Status error = 1; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto new file mode 100644 index 0000000000..a4e3ee28f1 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto @@ -0,0 +1,260 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +service SequenceService { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a sequence. + rpc CreateSequence(CreateSequenceRequest) returns (Sequence) { + option (google.api.http) = { + post: "/v1beta1/sequences" + body: "sequence" + }; + option (google.api.method_signature) = "sequence"; + }; + + // Creates a sequence. + rpc CreateStreamingSequence(CreateStreamingSequenceRequest) returns (StreamingSequence) { + option (google.api.http) = { + post: "/v1beta1/streamingSequences" + body: "streaming_sequence" + }; + option (google.api.method_signature) = "streaming_sequence"; + }; + + // Retrieves a sequence. + rpc GetSequenceReport(GetSequenceReportRequest) returns (SequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=sequences/*/sequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Retrieves a sequence. + rpc GetStreamingSequenceReport(GetStreamingSequenceReportRequest) returns (StreamingSequenceReport) { + option (google.api.http) = { + get: "/v1beta1/{name=streamingSequences/*/streamingSequenceReport}" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a sequence. + rpc AttemptSequence(AttemptSequenceRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1beta1/{name=sequences/*}" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; + + // Attempts a streaming sequence. + // May not function as expected in HTTP mode due to when http statuses are sent + // See https://github.com/googleapis/gapic-showcase/issues/1377 for more details + rpc AttemptStreamingSequence(AttemptStreamingSequenceRequest) returns (stream AttemptStreamingSequenceResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=streamingSequences/*}:stream" + body: "*" + }; + option (google.api.method_signature) = "name"; + }; +} + +message Sequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/Sequence" + pattern: "sequences/{sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 2; +} + +message StreamingSequence { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequence" + pattern: "streamingSequences/{streaming_sequence}" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Content that the stream will send + string content = 2; + + // A server response to an RPC Attempt in a sequence. + message Response { + // The status to return for an individual attempt. + google.rpc.Status status = 1; + + // The amount of time to delay sending the response. + google.protobuf.Duration delay = 2; + + // The index that the status should be sent + int32 response_index = 3; + } + + // Sequence of responses to return in order for each attempt. If empty, the + // default response is an immediate OK. + repeated Response responses = 3; +} + + +message StreamingSequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/StreamingSequenceReport" + pattern: "streamingSequences/{streaming_sequence}/streamingSequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // 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; + + // The status returned to the attempt. + google.rpc.Status status = 5; + + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message SequenceReport { + option (google.api.resource) = { + type: "showcase.googleapis.com/SequenceReport" + pattern: "sequences/{sequence}/sequenceReport" + }; + + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Contains metrics on individual RPC Attempts in a sequence. + message Attempt { + // The attempt number - starting at 0. + int32 attempt_number = 1; + + // The deadline dictated by the attempt to the server. + google.protobuf.Timestamp attempt_deadline = 2; + + // The time that the server responded to the RPC attempt. Used for + // calculating attempt_delay. + google.protobuf.Timestamp response_time = 3; + + // 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; + + // The status returned to the attempt. + google.rpc.Status status = 5; + } + + // The set of RPC attempts received by the server for a Sequence. + repeated Attempt attempts = 2; +} + +message CreateSequenceRequest { + Sequence sequence = 1; +} + +message CreateStreamingSequenceRequest { + StreamingSequence streaming_sequence = 1; +} + +message AttemptSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Sequence", + (google.api.field_behavior) = REQUIRED + ]; + +} + +message AttemptStreamingSequenceRequest { + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/StreamingSequence", + (google.api.field_behavior) = REQUIRED + ]; + + // used to send the index of the last failed message + // in the string "content" of an AttemptStreamingSequenceResponse + // needed for stream resumption logic testing + int32 last_fail_index = 2 [ + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The response message for the Echo methods. +message AttemptStreamingSequenceResponse { + // The content specified in the request. + string content = 1; + +} + +message GetSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/SequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} + +message GetStreamingSequenceReportRequest { + string name = 1 [ + (google.api.resource_reference).type = + "showcase.googleapis.com/StreamingSequenceReport", + (google.api.field_behavior) = REQUIRED + ]; +} diff --git a/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto new file mode 100644 index 0000000000..be66091074 --- /dev/null +++ b/java-showcase-3.21.0/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/testing.proto @@ -0,0 +1,392 @@ +// Copyright 2018 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; + +package google.showcase.v1beta1; + +option go_package = "github.com/googleapis/gapic-showcase/server/genproto"; +option java_package = "com.google.showcase.v1beta1"; +option java_multiple_files = true; +option ruby_package = "Google::Showcase::V1beta1"; + +// A service to facilitate running discrete sets of tests +// against Showcase. +// Adding this comment with special characters for comment formatting tests: +// 1. (abra->kadabra->alakazam) +// 2) [Nonsense][]: `pokemon/*/psychic/*` +service Testing { + // This service is meant to only run locally on the port 7469 (keypad digits + // for "show"). + option (google.api.default_host) = "localhost:7469"; + + // Creates a new testing session. + // Adding this comment with special characters for comment formatting tests: + // 1. (abra->kadabra->alakazam) + // 2) [Nonsense][]: `pokemon/*/psychic/*` + rpc CreateSession(CreateSessionRequest) returns (Session) { + option (google.api.http) = { + post: "/v1beta1/sessions" + body: "session" + }; + } + + // Gets a testing session. + rpc GetSession(GetSessionRequest) returns (Session) { + option (google.api.http) = { + get: "/v1beta1/{name=sessions/*}" + }; + } + + // Lists the current test sessions. + rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) { + option (google.api.http) = { + get: "/v1beta1/sessions" + }; + } + + // Delete a test session. + rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*}" + }; + } + + // Report on the status of a session. + // This generates a report detailing which tests have been completed, + // and an overall rollup. + rpc ReportSession(ReportSessionRequest) returns (ReportSessionResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*}:report" + }; + } + + // List the tests of a sessesion. + rpc ListTests(ListTestsRequest) returns (ListTestsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=sessions/*}/tests" + }; + } + + // 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. + rpc DeleteTest(DeleteTestRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=sessions/*/tests/*}" + }; + } + + // 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. + rpc VerifyTest(VerifyTestRequest) returns (VerifyTestResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=sessions/*/tests/*}:check" + }; + } +} + +// 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. +message Session { + option (google.api.resource) = { + type: "showcase.googleapis.com/Session" + pattern: "sessions/{session}" + }; + + // 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; + + // The specification versions understood by Showcase. + enum Version { + // Unspecified version. If passed on creation, the session will default + // to using the latest stable release. + VERSION_UNSPECIFIED = 0; + + // The latest v1. Currently, this is v1.0. + V1_LATEST = 1; + + // v1.0. (Until the spec is "GA", this will be a moving target.) + V1_0 = 2; + } + + // Required. The version this session is using. + Version version = 2; +} + +// The request for the CreateSession method. +message CreateSessionRequest { + // The session to be created. + // Sessions are immutable once they are created (although they can + // be deleted). + Session session = 1; +} + +// The request for the GetSession method. +message GetSessionRequest { + // The session to be retrieved. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// The request for the ListSessions method. +message ListSessionsRequest { + // The maximum number of sessions to return per page. + int32 page_size = 1; + + // The page token, for retrieving subsequent pages. + string page_token = 2; +} + +// Response for the ListSessions method. +message ListSessionsResponse { + // The sessions being returned. + repeated Session sessions = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// Request for the DeleteSession method. +message DeleteSessionRequest { + // The session to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Request message for reporting on a session. +message ReportSessionRequest { + // The session to be reported on. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; +} + +// Response message for reporting on a session. +message ReportSessionResponse { + // The topline state of the report. + enum Result { + RESULT_UNSPECIFIED = 0; + + // The session is complete, and everything passed. + PASSED = 1; + + // The session had an explicit failure. + FAILED = 2; + + // The session is incomplete. This is a failure response. + INCOMPLETE = 3; + } + + // The state of the report. + Result result = 1; + + // The test runs of this session. + repeated TestRun test_runs = 2; +} + +message Test { + option (google.api.resource) = { + type: "showcase.googleapis.com/Test" + pattern: "sessions/{session}/tests/{test}" + }; + + // 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; + + // Whether or not a test is required, recommended, or optional. + enum ExpectationLevel { + EXPECTATION_LEVEL_UNSPECIFIED = 0; + + // This test is strictly required. + 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; + + // 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; + } + + // The expectation level for this test. + ExpectationLevel expectation_level = 2; + + // A description of the test. + string description = 3; + + // 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. + message Blueprint { + option (google.api.resource) = { + type: "showcase.googleapis.com/Blueprint" + pattern: "sessions/{session}/tests/{test}/blueprints/{blueprint}" + }; + + // The name of this blueprint. + string name = 1; + + // A description of this blueprint. + string description = 2; + + // A message representing a method invocation. + message Invocation { + // The fully qualified name of the showcase method to be invoked. + string method = 1; + + // The request to be made if a specific request is necessary. + bytes serialized_request = 2; + } + + // The initial request to trigger this test. + Invocation request = 3; + + // An ordered list of method calls that can be called to trigger this test. + repeated Invocation additional_requests = 4; + } + + // 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 Blueprint blueprints = 4; +} + +// An issue found in the test. +message Issue { + // The different potential types of issues. + enum Type { + TYPE_UNSPECIFIED = 0; + + // The test was never instrumented. + SKIPPED = 1; + + // The test was started but never confirmed. + PENDING = 2; + + // The test was instrumented, but Showcase got an unexpected + // value when the generator tried to confirm success. + INCORRECT_CONFIRMATION = 3; + } + + // The type of the issue. + Type type = 1; + + // Severity levels. + enum Severity { + SEVERITY_UNSPECIFIED = 0; + + // Errors. + ERROR = 1; + + // Warnings. + WARNING = 2; + } + + // The severity of the issue. + Severity severity = 2; + + // A description of the issue. + string description = 3; +} + +// The request for the ListTests method. +message ListTestsRequest { + // The session. + string parent = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Session"]; + + // The maximum number of tests to return per page. + int32 page_size = 2; + + // The page token, for retrieving subsequent pages. + string page_token = 3; +} + +// The response for the ListTests method. +message ListTestsResponse { + // The tests being returned. + repeated Test tests = 1; + + // The next page token, if any. + // An empty value here means the last page has been reached. + string next_page_token = 2; +} + +// A TestRun is the result of running a Test. +message TestRun { + // 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).type = "showcase.googleapis.com/Test"]; + + + // An issue found with the test run. If empty, this test run was successful. + Issue issue = 2; +} + +// Request message for deleting a test. +message DeleteTestRequest { + // The test to be deleted. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; +} + +message VerifyTestRequest { + // The test to have an answer registered to it. + string name = 1 [ + (google.api.resource_reference).type = "showcase.googleapis.com/Test"]; + + // The answer from the test. + bytes answer = 2; + + // The answers from the test if multiple are to be checked + repeated bytes answers = 3; +} + +message VerifyTestResponse { + // An issue if check answer was unsuccessful. This will be empty if the check answer succeeded. + Issue issue = 1; +}