diff --git a/java-showcase/gapic-showcase/pom.xml b/java-showcase/gapic-showcase/pom.xml index 088faece10..c95ee76852 100644 --- a/java-showcase/gapic-showcase/pom.xml +++ b/java-showcase/gapic-showcase/pom.xml @@ -17,7 +17,7 @@ - 0.35.1 + 0.36.2 1.2.13 diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java index 1c24164c6f..2bd2776fd9 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceClient.java @@ -200,7 +200,7 @@ * * *

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 vaues they receive, use the response from this RPC as the request to VerifyEnum() + *

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.

@@ -1011,7 +1011,7 @@ public final UnaryCallable repeatDataBodyPatchCal /** * This method requests an enum value from the server. Depending on the contents of EnumRequest, * the enum value returned will be a known enum declared in the .proto file, or a made-up enum - * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues + * 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 @@ -1043,7 +1043,7 @@ public final EnumResponse getEnum(EnumRequest 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 vaues + * 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 diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java index e6b6a1f7d5..5f0a0b0a3d 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoClient.java @@ -120,6 +120,20 @@ * * * + *

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.

+ * + *

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

+ * + * + * + * *

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. * @@ -552,6 +566,67 @@ public final EchoErrorDetailsResponse echoErrorDetails(EchoErrorDetailsRequest r 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 diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java index 72a5c6a44e..41ab2f8e20 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/EchoSettings.java @@ -139,6 +139,12 @@ public UnaryCallSettings echoSettings() { 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(); @@ -337,6 +343,12 @@ public UnaryCallSettings.Builder echoSettings() { 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(); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java index ec77b21b63..b5bfc0bb2a 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/MessagingClient.java @@ -1779,7 +1779,7 @@ public final UnaryCallable deleteBlurbCallable() { * } * } * - * @param parent The resource name of the requested room or profile whos blurbs to list. + * @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) { @@ -1808,7 +1808,7 @@ public final ListBlurbsPagedResponse listBlurbs(ProfileName parent) { * } * } * - * @param parent The resource name of the requested room or profile whos blurbs to list. + * @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) { @@ -1837,7 +1837,7 @@ public final ListBlurbsPagedResponse listBlurbs(RoomName parent) { * } * } * - * @param parent The resource name of the requested room or profile whos blurbs to list. + * @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) { diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java index 6163556b41..76ac609f2d 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/SequenceServiceClient.java @@ -167,7 +167,7 @@ * * *

AttemptStreamingSequence - *

Attempts a streaming sequence. + *

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.

*
    @@ -856,7 +856,8 @@ public final UnaryCallable attemptSequenceCallabl // AUTO-GENERATED DOCUMENTATION AND METHOD. /** - * Attempts a streaming sequence. + * 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: * diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json index 8f8ce59b7a..1ab92719fe 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/gapic_metadata.json @@ -82,6 +82,9 @@ "Expand": { "methods": ["expandCallable"] }, + "FailEchoWithDetails": { + "methods": ["failEchoWithDetails", "failEchoWithDetailsCallable"] + }, "GetIamPolicy": { "methods": ["getIamPolicy", "getIamPolicyCallable"] }, diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java index e0282b2340..fd0fe7d6b3 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStub.java @@ -45,6 +45,8 @@ 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; @@ -81,6 +83,11 @@ public UnaryCallable echoCallable() { throw new UnsupportedOperationException("Not implemented: echoErrorDetailsCallable()"); } + public UnaryCallable + failEchoWithDetailsCallable() { + throw new UnsupportedOperationException("Not implemented: failEchoWithDetailsCallable()"); + } + public ServerStreamingCallable expandCallable() { throw new UnsupportedOperationException("Not implemented: expandCallable()"); } diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java index c09a9c8ecd..4ca4053954 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java @@ -73,6 +73,8 @@ 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; @@ -171,6 +173,8 @@ public class EchoStubSettings extends StubSettings { private final UnaryCallSettings echoSettings; private final UnaryCallSettings echoErrorDetailsSettings; + private final UnaryCallSettings + failEchoWithDetailsSettings; private final ServerStreamingCallSettings expandSettings; private final StreamingCallSettings collectSettings; private final StreamingCallSettings chatSettings; @@ -372,6 +376,12 @@ public UnaryCallSettings echoSettings() { 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; @@ -554,6 +564,7 @@ protected EchoStubSettings(Builder settingsBuilder) throws IOException { echoSettings = settingsBuilder.echoSettings().build(); echoErrorDetailsSettings = settingsBuilder.echoErrorDetailsSettings().build(); + failEchoWithDetailsSettings = settingsBuilder.failEchoWithDetailsSettings().build(); expandSettings = settingsBuilder.expandSettings().build(); collectSettings = settingsBuilder.collectSettings().build(); chatSettings = settingsBuilder.chatSettings().build(); @@ -576,6 +587,8 @@ public static class Builder extends StubSettings.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; @@ -653,6 +666,7 @@ protected Builder(ClientContext clientContext) { echoSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); echoErrorDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + failEchoWithDetailsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); expandSettings = ServerStreamingCallSettings.newBuilder(); collectSettings = StreamingCallSettings.newBuilder(); chatSettings = StreamingCallSettings.newBuilder(); @@ -673,6 +687,7 @@ protected Builder(ClientContext clientContext) { ImmutableList.>of( echoSettings, echoErrorDetailsSettings, + failEchoWithDetailsSettings, pagedExpandSettings, pagedExpandLegacySettings, pagedExpandLegacyMappedSettings, @@ -691,6 +706,7 @@ protected Builder(EchoStubSettings 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(); @@ -710,6 +726,7 @@ protected Builder(EchoStubSettings settings) { ImmutableList.>of( echoSettings, echoErrorDetailsSettings, + failEchoWithDetailsSettings, pagedExpandSettings, pagedExpandLegacySettings, pagedExpandLegacyMappedSettings, @@ -757,6 +774,11 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + builder + .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")) @@ -864,6 +886,12 @@ public UnaryCallSettings.Builder echoSettings() { 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; diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java index 31d9558ef7..1bbe21e29f 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java @@ -52,6 +52,8 @@ 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; @@ -94,6 +96,17 @@ public class GrpcEchoStub extends EchoStub { ProtoUtils.marshaller(EchoErrorDetailsResponse.getDefaultInstance())) .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())) + .build(); + private static final MethodDescriptor expandMethodDescriptor = MethodDescriptor.newBuilder() .setType(MethodDescriptor.MethodType.SERVER_STREAMING) @@ -214,6 +227,8 @@ public class GrpcEchoStub extends EchoStub { private final UnaryCallable echoCallable; private final UnaryCallable echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; private final ServerStreamingCallable expandCallable; private final ClientStreamingCallable collectCallable; private final BidiStreamingCallable chatCallable; @@ -323,6 +338,11 @@ protected GrpcEchoStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(echoErrorDetailsMethodDescriptor) .build(); + GrpcCallSettings + failEchoWithDetailsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .build(); GrpcCallSettings expandTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(expandMethodDescriptor) @@ -415,6 +435,11 @@ protected GrpcEchoStub( this.echoErrorDetailsCallable = callableFactory.createUnaryCallable( echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); this.expandCallable = callableFactory.createServerStreamingCallable( expandTransportSettings, settings.expandSettings(), clientContext); @@ -494,6 +519,12 @@ public UnaryCallable echoCallable() { return echoErrorDetailsCallable; } + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + @Override public ServerStreamingCallable expandCallable() { return expandCallable; diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java index dbb069935d..1a7f5e5cc4 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonEchoStub.java @@ -61,6 +61,8 @@ 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; @@ -159,6 +161,41 @@ public class HttpJsonEchoStub extends EchoStub { .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") @@ -551,6 +588,8 @@ public class HttpJsonEchoStub extends EchoStub { private final UnaryCallable echoCallable; private final UnaryCallable echoErrorDetailsCallable; + private final UnaryCallable + failEchoWithDetailsCallable; private final ServerStreamingCallable expandCallable; private final UnaryCallable pagedExpandCallable; private final UnaryCallable @@ -679,6 +718,13 @@ protected HttpJsonEchoStub( .setMethodDescriptor(echoErrorDetailsMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + failEchoWithDetailsTransportSettings = + HttpJsonCallSettings + .newBuilder() + .setMethodDescriptor(failEchoWithDetailsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings expandTransportSettings = HttpJsonCallSettings.newBuilder() .setMethodDescriptor(expandMethodDescriptor) @@ -775,6 +821,11 @@ protected HttpJsonEchoStub( this.echoErrorDetailsCallable = callableFactory.createUnaryCallable( echoErrorDetailsTransportSettings, settings.echoErrorDetailsSettings(), clientContext); + this.failEchoWithDetailsCallable = + callableFactory.createUnaryCallable( + failEchoWithDetailsTransportSettings, + settings.failEchoWithDetailsSettings(), + clientContext); this.expandCallable = callableFactory.createServerStreamingCallable( expandTransportSettings, settings.expandSettings(), clientContext); @@ -841,6 +892,7 @@ 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); @@ -870,6 +922,12 @@ public UnaryCallable echoCallable() { return echoErrorDetailsCallable; } + @Override + public UnaryCallable + failEchoWithDetailsCallable() { + return failEchoWithDetailsCallable; + } + @Override public ServerStreamingCallable expandCallable() { return expandCallable; diff --git a/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json b/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json index 98a1ee2340..328fa8f9db 100644 --- a/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json +++ b/java-showcase/gapic-showcase/src/main/resources/META-INF/native-image/com.google.showcase.v1beta1/reflect-config.json @@ -1808,6 +1808,15 @@ "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, @@ -2690,6 +2699,42 @@ "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, @@ -3104,6 +3149,24 @@ "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, @@ -3185,6 +3248,42 @@ "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, diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java index a662b27670..a558473f2f 100644 --- a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientHttpJsonTest.java @@ -212,6 +212,49 @@ public void echoErrorDetailsExceptionTest() throws 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 {} diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java index bcd44666ec..44ce3dff79 100644 --- a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/EchoClientTest.java @@ -223,6 +223,43 @@ public void echoErrorDetailsExceptionTest() throws 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 = diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java index 6f44ab3533..f505bb9ad9 100644 --- a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockEchoImpl.java @@ -100,6 +100,28 @@ public void echoErrorDetails( } } + @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(); diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml b/java-showcase/grpc-gapic-showcase-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 0000000000..731f7543e2 --- /dev/null +++ b/java-showcase/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/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java index 3de54af640..f4efab8f03 100644 --- a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceGrpc.java @@ -652,7 +652,7 @@ default void repeatDataBodyPatch( * *

          * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
    -     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the
    +     * .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.
    @@ -857,7 +857,7 @@ public void repeatDataBodyPatch(
          *
          * 
          * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
    -     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the
    +     * .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.
    @@ -1025,7 +1025,7 @@ public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch(
          *
          * 
          * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
    -     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the
    +     * .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.
    @@ -1191,7 +1191,7 @@ public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyPatch(
          *
          * 
          * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
    -     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the
    +     * .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.
    @@ -1365,7 +1365,7 @@ protected ComplianceFutureStub build(io.grpc.Channel channel, io.grpc.CallOption
          *
          * 
          * This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the
    -     * .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the
    +     * .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.
    diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java
    index e1642e4173..b83ffb26c4 100644
    --- a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java
    +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoGrpc.java
    @@ -128,6 +128,53 @@ private EchoGrpc() {}
         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;
    @@ -569,6 +616,27 @@ default void echoErrorDetails(
               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); + } + /** * * @@ -775,6 +843,29 @@ public void echoErrorDetails( 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); + } + /** * * @@ -965,6 +1056,25 @@ public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( 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); + } + /** * * @@ -1144,6 +1254,25 @@ public com.google.showcase.v1beta1.EchoErrorDetailsResponse echoErrorDetails( 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); + } + /** * * @@ -1289,6 +1418,26 @@ protected EchoFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions call 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); + } + /** * * @@ -1371,14 +1520,15 @@ protected EchoFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions call private static final int METHODID_ECHO = 0; private static final int METHODID_ECHO_ERROR_DETAILS = 1; - private static final int METHODID_EXPAND = 2; - private static final int METHODID_PAGED_EXPAND = 3; - private static final int METHODID_PAGED_EXPAND_LEGACY = 4; - private static final int METHODID_PAGED_EXPAND_LEGACY_MAPPED = 5; - private static final int METHODID_WAIT = 6; - private static final int METHODID_BLOCK = 7; - private static final int METHODID_COLLECT = 8; - private static final int METHODID_CHAT = 9; + 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, @@ -1409,6 +1559,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (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, @@ -1486,6 +1642,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser 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( @@ -1588,6 +1751,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new EchoFileDescriptorSupplier()) .addMethod(getEchoMethod()) .addMethod(getEchoErrorDetailsMethod()) + .addMethod(getFailEchoWithDetailsMethod()) .addMethod(getExpandMethod()) .addMethod(getCollectMethod()) .addMethod(getChatMethod()) diff --git a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java index 00b2939faf..139ea32045 100644 --- a/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java +++ b/java-showcase/grpc-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/SequenceServiceGrpc.java @@ -448,6 +448,8 @@ default void attemptSequence( * *
          * 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( @@ -568,6 +570,8 @@ public void attemptSequence( * *
          * 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( @@ -665,6 +669,8 @@ public com.google.protobuf.Empty attemptSequence( * *
          * 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") @@ -760,6 +766,8 @@ public com.google.protobuf.Empty attemptSequence( * *
          * 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 diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java index b68b0153c2..d1b1293a24 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EchoOuterClass.java @@ -60,6 +60,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r 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 @@ -158,7 +170,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\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\"x\n\r" + + "\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" @@ -177,13 +194,13 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\027PagedExpandResponseList\022\r\n" + "\005words\030\001 \003(\t\"\203\002\n" + "\037PagedExpandLegacyMappedResponse\022`\n" - + "\014alphabetized\030\001 \003(\0132J.google.showcase.v1beta1." - + "PagedExpandLegacyMappedResponse.AlphabetizedEntry\022\027\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" + + "\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" @@ -203,13 +220,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "BlockResponse\022\017\n" + "\007content\030\001 \001(\t*D\n" + "\010Severity\022\017\n" - + "\013UNNECESSARY\020\000\022\r\n" + + "\013UNNECESSARY\020\000\022\r" + + "\n" + "\tNECESSARY\020\001\022\n\n" + "\006URGENT\020\002\022\014\n" - + "\010CRITICAL\020\0032\262\r\n" + + "\010CRITICAL\020\0032\337\016\n" + "\004Echo\022\224\003\n" - + "\004Echo\022$.google.showcase.v1beta1.EchoRequest\032%.google.sh" - + "owcase.v1beta1.EchoResponse\"\276\002\202\323\344\223\002\027\"\022/v1beta1/echo:echo:\001*\212\323\344\223\002\232\002\022\010\n" + + "\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" @@ -218,9 +236,12 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\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.Echo" - + "ErrorDetailsRequest\0321.google.showcase.v1beta1.EchoErrorDetailsResponse\"&\202\323\344\223\002" - + " \"\033/v1beta1/echo:error-details:\001*\022\212\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\"/\332A\r" + "content,error\202\323\344\223\002\031\"\024/v1beta1/echo:expand:\001*0\001\022z\n" @@ -338,8 +359,30 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Details", }); - internal_static_google_showcase_v1beta1_ExpandRequest_descriptor = + 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, @@ -347,7 +390,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Content", "Error", "StreamWaitTime", }); internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(10); internal_static_google_showcase_v1beta1_PagedExpandRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_PagedExpandRequest_descriptor, @@ -355,7 +398,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Content", "PageSize", "PageToken", }); internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(11); internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_PagedExpandLegacyRequest_descriptor, @@ -363,7 +406,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Content", "MaxResults", "PageToken", }); internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(12); internal_static_google_showcase_v1beta1_PagedExpandResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_PagedExpandResponse_descriptor, @@ -371,7 +414,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Responses", "NextPageToken", }); internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(13); internal_static_google_showcase_v1beta1_PagedExpandResponseList_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_PagedExpandResponseList_descriptor, @@ -379,7 +422,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Words", }); internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(14); internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_PagedExpandLegacyMappedResponse_descriptor, @@ -397,7 +440,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_showcase_v1beta1_WaitRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(15); internal_static_google_showcase_v1beta1_WaitRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_WaitRequest_descriptor, @@ -405,7 +448,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndTime", "Ttl", "Error", "Success", "End", "Response", }); internal_static_google_showcase_v1beta1_WaitResponse_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(16); internal_static_google_showcase_v1beta1_WaitResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_WaitResponse_descriptor, @@ -413,7 +456,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Content", }); internal_static_google_showcase_v1beta1_WaitMetadata_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(17); internal_static_google_showcase_v1beta1_WaitMetadata_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_WaitMetadata_descriptor, @@ -421,7 +464,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndTime", }); internal_static_google_showcase_v1beta1_BlockRequest_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(18); internal_static_google_showcase_v1beta1_BlockRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_BlockRequest_descriptor, @@ -429,7 +472,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ResponseDelay", "Error", "Success", "Response", }); internal_static_google_showcase_v1beta1_BlockResponse_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(19); internal_static_google_showcase_v1beta1_BlockResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_showcase_v1beta1_BlockResponse_descriptor, diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java index fe5ae5306a..c2fda99b99 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequest.java @@ -61,7 +61,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
    -   * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
    +   * 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; @@ -410,7 +410,7 @@ public Builder mergeFrom( * * *
    -     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
    +     * 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; @@ -426,7 +426,7 @@ public boolean getUnknownEnum() { * * *
    -     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
    +     * 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; @@ -446,7 +446,7 @@ public Builder setUnknownEnum(boolean value) { * * *
    -     * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
    +     * 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; diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java index 09cef7e3cb..9c105e7d91 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/EnumRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface EnumRequestOrBuilder * * *
    -   * Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file.
    +   * 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; diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java new file mode 100644 index 0000000000..9f2d139e8d --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequest.java @@ -0,0 +1,642 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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 + +// Protobuf Java Version: 3.25.5 +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(); + } + + 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; + + @SuppressWarnings("serial") + 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_); + } + getUnknownFields().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 += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + 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); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.FailEchoWithDetailsRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.message_ = message_; + } + } + + @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_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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; + bitField0_ |= 0x00000001; + 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(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + 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.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java new file mode 100644 index 0000000000..0c6422d072 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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 + +// Protobuf Java Version: 3.25.5 +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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java new file mode 100644 index 0000000000..b69416a556 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponse.java @@ -0,0 +1,437 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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 + +// Protobuf Java Version: 3.25.5 +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(); + } + + 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 { + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java new file mode 100644 index 0000000000..c6cbc2da40 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/FailEchoWithDetailsResponseOrBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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 + +// Protobuf Java Version: 3.25.5 +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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java index a2ed989295..cb81dc77d7 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequest.java @@ -75,7 +75,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
    -   * The resource name of the requested room or profile whos blurbs to list.
    +   * The resource name of the requested room or profile who blurbs to list.
        * 
    * * @@ -101,7 +101,7 @@ public java.lang.String getParent() { * * *
    -   * The resource name of the requested room or profile whos blurbs to list.
    +   * The resource name of the requested room or profile who blurbs to list.
        * 
    * * @@ -596,7 +596,7 @@ public Builder mergeFrom( * * *
    -     * The resource name of the requested room or profile whos blurbs to list.
    +     * The resource name of the requested room or profile who blurbs to list.
          * 
    * * @@ -621,7 +621,7 @@ public java.lang.String getParent() { * * *
    -     * The resource name of the requested room or profile whos blurbs to list.
    +     * The resource name of the requested room or profile who blurbs to list.
          * 
    * * @@ -646,7 +646,7 @@ public com.google.protobuf.ByteString getParentBytes() { * * *
    -     * The resource name of the requested room or profile whos blurbs to list.
    +     * The resource name of the requested room or profile who blurbs to list.
          * 
    * * @@ -670,7 +670,7 @@ public Builder setParent(java.lang.String value) { * * *
    -     * The resource name of the requested room or profile whos blurbs to list.
    +     * The resource name of the requested room or profile who blurbs to list.
          * 
    * * @@ -690,7 +690,7 @@ public Builder clearParent() { * * *
    -     * The resource name of the requested room or profile whos blurbs to list.
    +     * The resource name of the requested room or profile who blurbs to list.
          * 
    * * diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java index 6b21ac5077..805511a6d1 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ListBlurbsRequestOrBuilder.java @@ -28,7 +28,7 @@ public interface ListBlurbsRequestOrBuilder * * *
    -   * The resource name of the requested room or profile whos blurbs to list.
    +   * The resource name of the requested room or profile who blurbs to list.
        * 
    * * @@ -43,7 +43,7 @@ public interface ListBlurbsRequestOrBuilder * * *
    -   * The resource name of the requested room or profile whos blurbs to list.
    +   * The resource name of the requested room or profile who blurbs to list.
        * 
    * * diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java new file mode 100644 index 0000000000..5c83918a8f --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryError.java @@ -0,0 +1,594 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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 + +// Protobuf Java Version: 3.25.5 +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(); + } + + 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; + + @SuppressWarnings("serial") + 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_); + } + getUnknownFields().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 += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + 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); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.PoetryError result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.poem_ = poem_; + } + } + + @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_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + poem_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string poem = 1; + * + * @return This builder for chaining. + */ + public Builder clearPoem() { + poem_ = getDefaultInstance().getPoem(); + bitField0_ = (bitField0_ & ~0x00000001); + 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; + 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.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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.java new file mode 100644 index 0000000000..e451326f4e --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/PoetryErrorOrBuilder.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 + +// Protobuf Java Version: 3.25.5 +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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java new file mode 100644 index 0000000000..3e60f331c6 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestError.java @@ -0,0 +1,2130 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * 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 + +// Protobuf Java Version: 3.25.5 +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(); + } + + 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(); + } + + 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_ = 0; + + /** + * + * + *
    +     * 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; + + @SuppressWarnings("serial") + 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_ = 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; + * + * @return The status. + */ + @java.lang.Override + public com.google.rpc.Code getStatus() { + com.google.rpc.Code result = com.google.rpc.Code.forNumber(status_); + return result == null ? com.google.rpc.Code.UNRECOGNIZED : result; + } + + public static final int DETAILS_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + 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)); + } + getUnknownFields().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 += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + code_ = 0; + message_ = ""; + status_ = 0; + if (detailsBuilder_ == null) { + details_ = java.util.Collections.emptyList(); + } else { + details_ = null; + detailsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000008); + 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); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.showcase.v1beta1.RestError.Status result) { + if (detailsBuilder_ == null) { + if (((bitField0_ & 0x00000008) != 0)) { + details_ = java.util.Collections.unmodifiableList(details_); + bitField0_ = (bitField0_ & ~0x00000008); + } + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + } + + private void buildPartial0(com.google.showcase.v1beta1.RestError.Status result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.code_ = code_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.message_ = message_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.status_ = status_; + } + } + + @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_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + if (detailsBuilder_ == null) { + if (!other.details_.isEmpty()) { + if (details_.isEmpty()) { + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000008); + } else { + ensureDetailsIsMutable(); + details_.addAll(other.details_); + } + onChanged(); + } + } else { + if (!other.details_.isEmpty()) { + if (detailsBuilder_.isEmpty()) { + detailsBuilder_.dispose(); + detailsBuilder_ = null; + details_ = other.details_; + bitField0_ = (bitField0_ & ~0x00000008); + detailsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDetailsFieldBuilder() + : null; + } else { + detailsBuilder_.addAllMessages(other.details_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + code_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + message_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 32: + { + status_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + com.google.protobuf.Any m = + input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (detailsBuilder_ == null) { + ensureDetailsIsMutable(); + details_.add(m); + } else { + detailsBuilder_.addMessage(m); + } + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + 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; + bitField0_ |= 0x00000001; + 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() { + bitField0_ = (bitField0_ & ~0x00000001); + 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; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * + * + *
    +       * This corresponds to `google.rpc.Status.message`.
    +       * 
    + * + * string message = 2; + * + * @return This builder for chaining. + */ + public Builder clearMessage() { + message_ = getDefaultInstance().getMessage(); + bitField0_ = (bitField0_ & ~0x00000002); + 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; + bitField0_ |= 0x00000002; + 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; + bitField0_ |= 0x00000004; + 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() { + com.google.rpc.Code result = com.google.rpc.Code.forNumber(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(); + } + bitField0_ |= 0x00000004; + 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() { + bitField0_ = (bitField0_ & ~0x00000004); + status_ = 0; + onChanged(); + return this; + } + + private java.util.List details_ = java.util.Collections.emptyList(); + + private void ensureDetailsIsMutable() { + if (!((bitField0_ & 0x00000008) != 0)) { + details_ = new java.util.ArrayList(details_); + bitField0_ |= 0x00000008; + } + } + + 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_ & ~0x00000008); + 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_ & 0x00000008) != 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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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; + } + } + + private int bitField0_; + 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 ((bitField0_ & 0x00000001) != 0); + } + + /** + * .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 error_ == null + ? com.google.showcase.v1beta1.RestError.Status.getDefaultInstance() + : error_; + } + + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getError()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getError()); + } + size += getUnknownFields().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 (!getUnknownFields().equals(other.getUnknownFields())) 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) + getUnknownFields().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) { + getErrorFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + 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 (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.RestError result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.error_ = errorBuilder_ == null ? error_ : errorBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @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.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getErrorFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + 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 ((bitField0_ & 0x00000001) != 0); + } + + /** + * .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; + } else { + errorBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + 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(); + } else { + errorBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder mergeError(com.google.showcase.v1beta1.RestError.Status value) { + if (errorBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && error_ != null + && error_ != com.google.showcase.v1beta1.RestError.Status.getDefaultInstance()) { + getErrorBuilder().mergeFrom(value); + } else { + error_ = value; + } + } else { + errorBuilder_.mergeFrom(value); + } + if (error_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public Builder clearError() { + bitField0_ = (bitField0_ & ~0x00000001); + error_ = null; + if (errorBuilder_ != null) { + errorBuilder_.dispose(); + errorBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.RestError.Status error = 1; */ + public com.google.showcase.v1beta1.RestError.Status.Builder getErrorBuilder() { + bitField0_ |= 0x00000001; + 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 { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.java new file mode 100644 index 0000000000..a7f093ef41 --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOrBuilder.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/rest_error.proto + +// Protobuf Java Version: 3.25.5 +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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.java new file mode 100644 index 0000000000..ec7de4f5be --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/RestErrorOuterClass.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/rest_error.proto + +// Protobuf Java Version: 3.25.5 +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/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java index 0d6201e0ab..edbcaafef3 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequest.java @@ -120,7 +120,7 @@ public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { * * *
    -   * The field mask to determine wich fields are to be updated. If empty, the
    +   * The field mask to determine which fields are to be updated. If empty, the
        * server will assume all fields are to be updated.
        * 
    * @@ -137,7 +137,7 @@ public boolean hasUpdateMask() { * * *
    -   * The field mask to determine wich fields are to be updated. If empty, the
    +   * The field mask to determine which fields are to be updated. If empty, the
        * server will assume all fields are to be updated.
        * 
    * @@ -154,7 +154,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
    -   * The field mask to determine wich fields are to be updated. If empty, the
    +   * The field mask to determine which fields are to be updated. If empty, the
        * server will assume all fields are to be updated.
        * 
    * @@ -761,7 +761,7 @@ public com.google.showcase.v1beta1.BlurbOrBuilder getBlurbOrBuilder() { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -777,7 +777,7 @@ public boolean hasUpdateMask() { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -799,7 +799,7 @@ public com.google.protobuf.FieldMask getUpdateMask() { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -823,7 +823,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask value) { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -844,7 +844,7 @@ public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForVal * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -873,7 +873,7 @@ public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -894,7 +894,7 @@ public Builder clearUpdateMask() { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -910,7 +910,7 @@ public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * @@ -930,7 +930,7 @@ public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { * * *
    -     * The field mask to determine wich fields are to be updated. If empty, the
    +     * The field mask to determine which fields are to be updated. If empty, the
          * server will assume all fields are to be updated.
          * 
    * diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java index cd85a9187b..69d2a77bb6 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/UpdateBlurbRequestOrBuilder.java @@ -65,7 +65,7 @@ public interface UpdateBlurbRequestOrBuilder * * *
    -   * The field mask to determine wich fields are to be updated. If empty, the
    +   * The field mask to determine which fields are to be updated. If empty, the
        * server will assume all fields are to be updated.
        * 
    * @@ -79,7 +79,7 @@ public interface UpdateBlurbRequestOrBuilder * * *
    -   * The field mask to determine wich fields are to be updated. If empty, the
    +   * The field mask to determine which fields are to be updated. If empty, the
        * server will assume all fields are to be updated.
        * 
    * @@ -93,7 +93,7 @@ public interface UpdateBlurbRequestOrBuilder * * *
    -   * The field mask to determine wich fields are to be updated. If empty, the
    +   * The field mask to determine which fields are to be updated. If empty, the
        * server will assume all fields are to be updated.
        * 
    * diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto index 9b6c0b7d75..4e8cba6b25 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/compliance.proto @@ -102,7 +102,7 @@ service Compliance { } // This method requests an enum value from the server. Depending on the contents of EnumRequest, the enum value returned will be a known enum declared in the - // .proto file, or a made-up enum value the is unknown to the client. To verify that clients can round-trip unknown enum vaues they receive, use the + // .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 @@ -256,7 +256,7 @@ enum Continent { message EnumRequest { - // Whether the client is requesting a new, unknown enum value or a known enum value already declard in this proto file. + // 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; } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto index eda1861a2d..55b7ab578a 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/echo.proto @@ -100,6 +100,20 @@ service Echo { }; } + // 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) { @@ -273,6 +287,24 @@ 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. diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto index 62196dfced..330dc8c9e7 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/messaging.proto @@ -361,7 +361,7 @@ message UpdateBlurbRequest { // The blurb to update. Blurb blurb = 1; - // The field mask to determine wich fields are to be updated. If empty, the + // 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; } @@ -379,7 +379,7 @@ message DeleteBlurbRequest { // The request message for the google.showcase.v1beta1.Messaging\ListBlurbs // method. message ListBlurbsRequest { - // The resource name of the requested room or profile whos blurbs to list. + // 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", diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/rest_error.proto b/java-showcase/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/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/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto index 4c2a6bbe07..a4e3ee28f1 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/proto/schema/google/showcase/v1beta1/sequence.proto @@ -79,6 +79,8 @@ service SequenceService { }; // 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" diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/AsyncFailEchoWithDetails.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/AsyncFailEchoWithDetails.java new file mode 100644 index 0000000000..b0e1ff9468 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/AsyncFailEchoWithDetails.java @@ -0,0 +1,47 @@ +/* + * Copyright 2025 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; + +public class AsyncFailEchoWithDetails { + + public static void main(String[] args) throws Exception { + asyncFailEchoWithDetails(); + } + + public static void asyncFailEchoWithDetails() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying 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(); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/SyncFailEchoWithDetails.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/SyncFailEchoWithDetails.java new file mode 100644 index 0000000000..acd827781c --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/echo/failechowithdetails/SyncFailEchoWithDetails.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. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_sync] +import com.google.showcase.v1beta1.EchoClient; +import com.google.showcase.v1beta1.FailEchoWithDetailsRequest; +import com.google.showcase.v1beta1.FailEchoWithDetailsResponse; + +public class SyncFailEchoWithDetails { + + public static void main(String[] args) throws Exception { + syncFailEchoWithDetails(); + } + + public static void syncFailEchoWithDetails() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying 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); + } + } +} +// [END localhost7469_v1beta1_generated_Echo_FailEchoWithDetails_sync]