From fe0d149df244cbb0241f9cd577a4335b249993a3 Mon Sep 17 00:00:00 2001 From: Diego Date: Fri, 1 May 2026 14:22:54 -0400 Subject: [PATCH] chore: demo of showcase with json_name --- .../showcase/v1beta1/ComplianceClient.java | 237 ++++ .../showcase/v1beta1/ComplianceSettings.java | 34 + .../showcase/v1beta1/gapic_metadata.json | 9 + .../showcase/v1beta1/stub/ComplianceStub.java | 14 + .../v1beta1/stub/ComplianceStubSettings.java | 79 ++ .../v1beta1/stub/GrpcComplianceStub.java | 89 ++ .../v1beta1/stub/HttpJsonComplianceStub.java | 190 +++ .../reflect-config.json | 18 + .../v1beta1/ComplianceClientHttpJsonTest.java | 251 ++++ .../v1beta1/ComplianceClientTest.java | 171 +++ .../showcase/v1beta1/MockComplianceImpl.java | 66 + .../showcase/v1beta1/ComplianceGrpc.java | 406 ++++++ .../showcase/v1beta1/ComplianceData.java | 323 +++-- .../v1beta1/ComplianceDataOrBuilder.java | 14 + .../v1beta1/ComplianceOuterClass.java | 144 +- .../v1beta1/CustomBindingRequest.java | 1223 +++++++++++++++++ .../CustomBindingRequestOrBuilder.java | 112 ++ .../google/showcase/v1beta1/compliance.proto | 36 + .../AsyncRepeatDataBodyCustomMessage.java | 54 + .../SyncRepeatDataBodyCustomMessage.java | 50 + .../AsyncRepeatDataCustomPath.java | 54 + .../SyncRepeatDataCustomPath.java | 50 + .../AsyncRepeatDataCustomQuery.java | 54 + .../SyncRepeatDataCustomQuery.java | 50 + 24 files changed, 3582 insertions(+), 146 deletions(-) create mode 100644 java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequest.java create mode 100644 java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequestOrBuilder.java create mode 100644 java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/AsyncRepeatDataBodyCustomMessage.java create mode 100644 java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/SyncRepeatDataBodyCustomMessage.java create mode 100644 java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/AsyncRepeatDataCustomPath.java create mode 100644 java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/SyncRepeatDataCustomPath.java create mode 100644 java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/AsyncRepeatDataCustomQuery.java create mode 100644 java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/SyncRepeatDataCustomQuery.java 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 7f1d2095d6ef..44a9dc04ab5d 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 @@ -229,6 +229,48 @@ * * * + *

RepeatDataCustomPath + *

This method echoes the ComplianceData request. This method exercises sending some parameters as path variables with custom json_name. + * + *

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.

+ * + * + * + * + *

RepeatDataBodyCustomMessage + *

Testing custom json_name option in custom message bodies + * + *

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.

+ * + * + * + * + *

RepeatDataCustomQuery + *

Testing custom query parameter mapping with dashes + * + *

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.

+ * + * + * + * *

ListLocations *

Lists information about the supported locations for this service. * @@ -1141,6 +1183,201 @@ public final UnaryCallable verifyEnumCallable() { return stub.verifyEnumCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * path variables with custom json_name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   CustomBindingRequest request =
+   *       CustomBindingRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setCustomKebabName("customKebabName-2062111197")
+   *           .setCustomBodyMessage(ComplianceData.newBuilder().build())
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataCustomPath(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataCustomPath(CustomBindingRequest request) { + return repeatDataCustomPathCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * path variables with custom json_name. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   CustomBindingRequest request =
+   *       CustomBindingRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setCustomKebabName("customKebabName-2062111197")
+   *           .setCustomBodyMessage(ComplianceData.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataCustomPathCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataCustomPathCallable() { + return stub.repeatDataCustomPathCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Testing custom json_name option in custom message bodies + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   CustomBindingRequest request =
+   *       CustomBindingRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setCustomKebabName("customKebabName-2062111197")
+   *           .setCustomBodyMessage(ComplianceData.newBuilder().build())
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataBodyCustomMessage(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataBodyCustomMessage(CustomBindingRequest request) { + return repeatDataBodyCustomMessageCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Testing custom json_name option in custom message bodies + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   CustomBindingRequest request =
+   *       CustomBindingRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setCustomKebabName("customKebabName-2062111197")
+   *           .setCustomBodyMessage(ComplianceData.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataBodyCustomMessageCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + repeatDataBodyCustomMessageCallable() { + return stub.repeatDataBodyCustomMessageCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Testing custom query parameter mapping with dashes + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   CustomBindingRequest request =
+   *       CustomBindingRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setCustomKebabName("customKebabName-2062111197")
+   *           .setCustomBodyMessage(ComplianceData.newBuilder().build())
+   *           .build();
+   *   RepeatResponse response = complianceClient.repeatDataCustomQuery(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataCustomQuery(CustomBindingRequest request) { + return repeatDataCustomQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Testing custom query parameter mapping with dashes + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (ComplianceClient complianceClient = ComplianceClient.create()) {
+   *   CustomBindingRequest request =
+   *       CustomBindingRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setInfo(ComplianceData.newBuilder().build())
+   *           .setServerVerify(true)
+   *           .setCustomKebabName("customKebabName-2062111197")
+   *           .setCustomBodyMessage(ComplianceData.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       complianceClient.repeatDataCustomQueryCallable().futureCall(request);
+   *   // Do something.
+   *   RepeatResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable repeatDataCustomQueryCallable() { + return stub.repeatDataCustomQueryCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Lists information about the supported locations for this service. diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java index 27c7f1a83381..7fdca7d315d8 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/ComplianceSettings.java @@ -147,6 +147,22 @@ public UnaryCallSettings verifyEnumSettings() { return ((ComplianceStubSettings) getStubSettings()).verifyEnumSettings(); } + /** Returns the object with the settings used for calls to repeatDataCustomPath. */ + public UnaryCallSettings repeatDataCustomPathSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataCustomPathSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataBodyCustomMessage. */ + public UnaryCallSettings + repeatDataBodyCustomMessageSettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataBodyCustomMessageSettings(); + } + + /** Returns the object with the settings used for calls to repeatDataCustomQuery. */ + public UnaryCallSettings repeatDataCustomQuerySettings() { + return ((ComplianceStubSettings) getStubSettings()).repeatDataCustomQuerySettings(); + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -337,6 +353,24 @@ public UnaryCallSettings.Builder verifyEnumSettings( return getStubSettingsBuilder().verifyEnumSettings(); } + /** Returns the builder for the settings used for calls to repeatDataCustomPath. */ + public UnaryCallSettings.Builder + repeatDataCustomPathSettings() { + return getStubSettingsBuilder().repeatDataCustomPathSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataBodyCustomMessage. */ + public UnaryCallSettings.Builder + repeatDataBodyCustomMessageSettings() { + return getStubSettingsBuilder().repeatDataBodyCustomMessageSettings(); + } + + /** Returns the builder for the settings used for calls to repeatDataCustomQuery. */ + public UnaryCallSettings.Builder + repeatDataCustomQuerySettings() { + return getStubSettingsBuilder().repeatDataCustomQuerySettings(); + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> 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 4d11ed39b93e..8a25ffa1fba0 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 @@ -25,6 +25,9 @@ "RepeatDataBody": { "methods": ["repeatDataBody", "repeatDataBodyCallable"] }, + "RepeatDataBodyCustomMessage": { + "methods": ["repeatDataBodyCustomMessage", "repeatDataBodyCustomMessageCallable"] + }, "RepeatDataBodyInfo": { "methods": ["repeatDataBodyInfo", "repeatDataBodyInfoCallable"] }, @@ -34,6 +37,12 @@ "RepeatDataBodyPut": { "methods": ["repeatDataBodyPut", "repeatDataBodyPutCallable"] }, + "RepeatDataCustomPath": { + "methods": ["repeatDataCustomPath", "repeatDataCustomPathCallable"] + }, + "RepeatDataCustomQuery": { + "methods": ["repeatDataCustomQuery", "repeatDataCustomQueryCallable"] + }, "RepeatDataPathResource": { "methods": ["repeatDataPathResource", "repeatDataPathResourceCallable"] }, diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java index 022d3dee15f1..168aa68a07a2 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStub.java @@ -30,6 +30,7 @@ import com.google.iam.v1.SetIamPolicyRequest; import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.CustomBindingRequest; import com.google.showcase.v1beta1.EnumRequest; import com.google.showcase.v1beta1.EnumResponse; import com.google.showcase.v1beta1.RepeatRequest; @@ -87,6 +88,19 @@ public UnaryCallable verifyEnumCallable() { throw new UnsupportedOperationException("Not implemented: verifyEnumCallable()"); } + public UnaryCallable repeatDataCustomPathCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataCustomPathCallable()"); + } + + public UnaryCallable repeatDataBodyCustomMessageCallable() { + throw new UnsupportedOperationException( + "Not implemented: repeatDataBodyCustomMessageCallable()"); + } + + public UnaryCallable repeatDataCustomQueryCallable() { + throw new UnsupportedOperationException("Not implemented: repeatDataCustomQueryCallable()"); + } + public UnaryCallable listLocationsPagedCallable() { throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()"); diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java index 43de8c07b6ea..153047be9417 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/ComplianceStubSettings.java @@ -58,6 +58,7 @@ import com.google.iam.v1.SetIamPolicyRequest; import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; +import com.google.showcase.v1beta1.CustomBindingRequest; import com.google.showcase.v1beta1.EnumRequest; import com.google.showcase.v1beta1.EnumResponse; import com.google.showcase.v1beta1.RepeatRequest; @@ -134,6 +135,12 @@ public class ComplianceStubSettings extends StubSettings private final UnaryCallSettings repeatDataBodyPatchSettings; private final UnaryCallSettings getEnumSettings; private final UnaryCallSettings verifyEnumSettings; + private final UnaryCallSettings + repeatDataCustomPathSettings; + private final UnaryCallSettings + repeatDataBodyCustomMessageSettings; + private final UnaryCallSettings + repeatDataCustomQuerySettings; private final PagedCallSettings< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -244,6 +251,22 @@ public UnaryCallSettings verifyEnumSettings() { return verifyEnumSettings; } + /** Returns the object with the settings used for calls to repeatDataCustomPath. */ + public UnaryCallSettings repeatDataCustomPathSettings() { + return repeatDataCustomPathSettings; + } + + /** Returns the object with the settings used for calls to repeatDataBodyCustomMessage. */ + public UnaryCallSettings + repeatDataBodyCustomMessageSettings() { + return repeatDataBodyCustomMessageSettings; + } + + /** Returns the object with the settings used for calls to repeatDataCustomQuery. */ + public UnaryCallSettings repeatDataCustomQuerySettings() { + return repeatDataCustomQuerySettings; + } + /** Returns the object with the settings used for calls to listLocations. */ public PagedCallSettings listLocationsSettings() { @@ -387,6 +410,10 @@ protected ComplianceStubSettings(Builder settingsBuilder) throws IOException { repeatDataBodyPatchSettings = settingsBuilder.repeatDataBodyPatchSettings().build(); getEnumSettings = settingsBuilder.getEnumSettings().build(); verifyEnumSettings = settingsBuilder.verifyEnumSettings().build(); + repeatDataCustomPathSettings = settingsBuilder.repeatDataCustomPathSettings().build(); + repeatDataBodyCustomMessageSettings = + settingsBuilder.repeatDataBodyCustomMessageSettings().build(); + repeatDataCustomQuerySettings = settingsBuilder.repeatDataCustomQuerySettings().build(); listLocationsSettings = settingsBuilder.listLocationsSettings().build(); getLocationSettings = settingsBuilder.getLocationSettings().build(); setIamPolicySettings = settingsBuilder.setIamPolicySettings().build(); @@ -422,6 +449,12 @@ public static class Builder extends StubSettings.Builder getEnumSettings; private final UnaryCallSettings.Builder verifyEnumSettings; + private final UnaryCallSettings.Builder + repeatDataCustomPathSettings; + private final UnaryCallSettings.Builder + repeatDataBodyCustomMessageSettings; + private final UnaryCallSettings.Builder + repeatDataCustomQuerySettings; private final PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> listLocationsSettings; @@ -467,6 +500,9 @@ protected Builder(ClientContext clientContext) { repeatDataBodyPatchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); getEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); verifyEnumSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataCustomPathSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataBodyCustomMessageSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + repeatDataCustomQuerySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); setIamPolicySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); @@ -485,6 +521,9 @@ protected Builder(ClientContext clientContext) { repeatDataBodyPatchSettings, getEnumSettings, verifyEnumSettings, + repeatDataCustomPathSettings, + repeatDataBodyCustomMessageSettings, + repeatDataCustomQuerySettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, @@ -507,6 +546,10 @@ protected Builder(ComplianceStubSettings settings) { repeatDataBodyPatchSettings = settings.repeatDataBodyPatchSettings.toBuilder(); getEnumSettings = settings.getEnumSettings.toBuilder(); verifyEnumSettings = settings.verifyEnumSettings.toBuilder(); + repeatDataCustomPathSettings = settings.repeatDataCustomPathSettings.toBuilder(); + repeatDataBodyCustomMessageSettings = + settings.repeatDataBodyCustomMessageSettings.toBuilder(); + repeatDataCustomQuerySettings = settings.repeatDataCustomQuerySettings.toBuilder(); listLocationsSettings = settings.listLocationsSettings.toBuilder(); getLocationSettings = settings.getLocationSettings.toBuilder(); setIamPolicySettings = settings.setIamPolicySettings.toBuilder(); @@ -525,6 +568,9 @@ protected Builder(ComplianceStubSettings settings) { repeatDataBodyPatchSettings, getEnumSettings, verifyEnumSettings, + repeatDataCustomPathSettings, + repeatDataBodyCustomMessageSettings, + repeatDataCustomQuerySettings, listLocationsSettings, getLocationSettings, setIamPolicySettings, @@ -607,6 +653,21 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder + .repeatDataCustomPathSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataBodyCustomMessageSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .repeatDataCustomQuerySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + builder .listLocationsSettings() .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) @@ -702,6 +763,24 @@ public UnaryCallSettings.Builder verifyEnumSettings( return verifyEnumSettings; } + /** Returns the builder for the settings used for calls to repeatDataCustomPath. */ + public UnaryCallSettings.Builder + repeatDataCustomPathSettings() { + return repeatDataCustomPathSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataBodyCustomMessage. */ + public UnaryCallSettings.Builder + repeatDataBodyCustomMessageSettings() { + return repeatDataBodyCustomMessageSettings; + } + + /** Returns the builder for the settings used for calls to repeatDataCustomQuery. */ + public UnaryCallSettings.Builder + repeatDataCustomQuerySettings() { + return repeatDataCustomQuerySettings; + } + /** Returns the builder for the settings used for calls to listLocations. */ public PagedCallSettings.Builder< ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java index 3949f8d8c968..bb988f6b1911 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcComplianceStub.java @@ -36,6 +36,7 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.showcase.v1beta1.CustomBindingRequest; import com.google.showcase.v1beta1.EnumRequest; import com.google.showcase.v1beta1.EnumResponse; import com.google.showcase.v1beta1.RepeatRequest; @@ -154,6 +155,39 @@ public class GrpcComplianceStub extends ComplianceStub { .setSampledToLocalTracing(true) .build(); + private static final MethodDescriptor + repeatDataCustomPathMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataCustomPath") + .setRequestMarshaller( + ProtoUtils.marshaller(CustomBindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataBodyCustomMessageMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyCustomMessage") + .setRequestMarshaller( + ProtoUtils.marshaller(CustomBindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + + private static final MethodDescriptor + repeatDataCustomQueryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataCustomQuery") + .setRequestMarshaller( + ProtoUtils.marshaller(CustomBindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(RepeatResponse.getDefaultInstance())) + .setSampledToLocalTracing(true) + .build(); + private static final MethodDescriptor listLocationsMethodDescriptor = MethodDescriptor.newBuilder() @@ -215,6 +249,10 @@ public class GrpcComplianceStub extends ComplianceStub { private final UnaryCallable repeatDataBodyPatchCallable; private final UnaryCallable getEnumCallable; private final UnaryCallable verifyEnumCallable; + private final UnaryCallable repeatDataCustomPathCallable; + private final UnaryCallable + repeatDataBodyCustomMessageCallable; + private final UnaryCallable repeatDataCustomQueryCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -337,6 +375,27 @@ protected GrpcComplianceStub( GrpcCallSettings.newBuilder() .setMethodDescriptor(verifyEnumMethodDescriptor) .build(); + GrpcCallSettings repeatDataCustomPathTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataCustomPathMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.custom_path_field", + String.valueOf(request.getInfo().getCustomPathField())); + return builder.build(); + }) + .build(); + GrpcCallSettings + repeatDataBodyCustomMessageTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyCustomMessageMethodDescriptor) + .build(); + GrpcCallSettings repeatDataCustomQueryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(repeatDataCustomQueryMethodDescriptor) + .build(); GrpcCallSettings listLocationsTransportSettings = GrpcCallSettings.newBuilder() .setMethodDescriptor(listLocationsMethodDescriptor) @@ -434,6 +493,21 @@ protected GrpcComplianceStub( this.verifyEnumCallable = callableFactory.createUnaryCallable( verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.repeatDataCustomPathCallable = + callableFactory.createUnaryCallable( + repeatDataCustomPathTransportSettings, + settings.repeatDataCustomPathSettings(), + clientContext); + this.repeatDataBodyCustomMessageCallable = + callableFactory.createUnaryCallable( + repeatDataBodyCustomMessageTransportSettings, + settings.repeatDataBodyCustomMessageSettings(), + clientContext); + this.repeatDataCustomQueryCallable = + callableFactory.createUnaryCallable( + repeatDataCustomQueryTransportSettings, + settings.repeatDataCustomQuerySettings(), + clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -513,6 +587,21 @@ public UnaryCallable verifyEnumCallable() { return verifyEnumCallable; } + @Override + public UnaryCallable repeatDataCustomPathCallable() { + return repeatDataCustomPathCallable; + } + + @Override + public UnaryCallable repeatDataBodyCustomMessageCallable() { + return repeatDataBodyCustomMessageCallable; + } + + @Override + public UnaryCallable repeatDataCustomQueryCallable() { + return repeatDataCustomQueryCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; diff --git a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java index 247f16c37da8..4f9e08c18f47 100644 --- a/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java +++ b/java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java @@ -41,6 +41,7 @@ import com.google.iam.v1.TestIamPermissionsRequest; import com.google.iam.v1.TestIamPermissionsResponse; import com.google.protobuf.TypeRegistry; +import com.google.showcase.v1beta1.CustomBindingRequest; import com.google.showcase.v1beta1.EnumRequest; import com.google.showcase.v1beta1.EnumResponse; import com.google.showcase.v1beta1.RepeatRequest; @@ -518,6 +519,132 @@ public class HttpJsonComplianceStub extends ComplianceStub { .build()) .build(); + private static final ApiMethodDescriptor + repeatDataCustomPathMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataCustomPath") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat/{info.custom-path-field}:custompath", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, + "info.custom-path-field", + request.getInfo().getCustomPathField()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "custom-body-message", request.getCustomBodyMessage()); + serializer.putQueryParam( + fields, "custom-kebab-name", request.getCustomKebabName()); + serializer.putQueryParam(fields, "info", request.getInfo()); + serializer.putQueryParam(fields, "name", request.getName()); + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataBodyCustomMessageMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataBodyCustomMessage") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:bodycustommessage", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "custom-kebab-name", request.getCustomKebabName()); + serializer.putQueryParam(fields, "info", request.getInfo()); + serializer.putQueryParam(fields, "name", request.getName()); + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody( + "custom-body-message", request.getCustomBodyMessage(), false)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + repeatDataCustomQueryMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.showcase.v1beta1.Compliance/RepeatDataCustomQuery") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/repeat:customquery", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "custom-body-message", request.getCustomBodyMessage()); + serializer.putQueryParam( + fields, "custom-kebab-name", request.getCustomKebabName()); + serializer.putQueryParam(fields, "info", request.getInfo()); + serializer.putQueryParam(fields, "name", request.getName()); + serializer.putQueryParam( + fields, "serverVerify", request.getServerVerify()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(RepeatResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private static final ApiMethodDescriptor listLocationsMethodDescriptor = ApiMethodDescriptor.newBuilder() @@ -711,6 +838,10 @@ public class HttpJsonComplianceStub extends ComplianceStub { private final UnaryCallable repeatDataBodyPatchCallable; private final UnaryCallable getEnumCallable; private final UnaryCallable verifyEnumCallable; + private final UnaryCallable repeatDataCustomPathCallable; + private final UnaryCallable + repeatDataBodyCustomMessageCallable; + private final UnaryCallable repeatDataCustomQueryCallable; private final UnaryCallable listLocationsCallable; private final UnaryCallable listLocationsPagedCallable; @@ -843,6 +974,32 @@ protected HttpJsonComplianceStub( .setMethodDescriptor(verifyEnumMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings + repeatDataCustomPathTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataCustomPathMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add( + "info.custom_path_field", + String.valueOf(request.getInfo().getCustomPathField())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + repeatDataBodyCustomMessageTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataBodyCustomMessageMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + repeatDataCustomQueryTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(repeatDataCustomQueryMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); HttpJsonCallSettings listLocationsTransportSettings = HttpJsonCallSettings.newBuilder() @@ -946,6 +1103,21 @@ protected HttpJsonComplianceStub( this.verifyEnumCallable = callableFactory.createUnaryCallable( verifyEnumTransportSettings, settings.verifyEnumSettings(), clientContext); + this.repeatDataCustomPathCallable = + callableFactory.createUnaryCallable( + repeatDataCustomPathTransportSettings, + settings.repeatDataCustomPathSettings(), + clientContext); + this.repeatDataBodyCustomMessageCallable = + callableFactory.createUnaryCallable( + repeatDataBodyCustomMessageTransportSettings, + settings.repeatDataBodyCustomMessageSettings(), + clientContext); + this.repeatDataCustomQueryCallable = + callableFactory.createUnaryCallable( + repeatDataCustomQueryTransportSettings, + settings.repeatDataCustomQuerySettings(), + clientContext); this.listLocationsCallable = callableFactory.createUnaryCallable( listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); @@ -984,6 +1156,9 @@ public static List getMethodDescriptors() { methodDescriptors.add(repeatDataBodyPatchMethodDescriptor); methodDescriptors.add(getEnumMethodDescriptor); methodDescriptors.add(verifyEnumMethodDescriptor); + methodDescriptors.add(repeatDataCustomPathMethodDescriptor); + methodDescriptors.add(repeatDataBodyCustomMessageMethodDescriptor); + methodDescriptors.add(repeatDataCustomQueryMethodDescriptor); methodDescriptors.add(listLocationsMethodDescriptor); methodDescriptors.add(getLocationMethodDescriptor); methodDescriptors.add(setIamPolicyMethodDescriptor); @@ -1042,6 +1217,21 @@ public UnaryCallable verifyEnumCallable() { return verifyEnumCallable; } + @Override + public UnaryCallable repeatDataCustomPathCallable() { + return repeatDataCustomPathCallable; + } + + @Override + public UnaryCallable repeatDataBodyCustomMessageCallable() { + return repeatDataBodyCustomMessageCallable; + } + + @Override + public UnaryCallable repeatDataCustomQueryCallable() { + return repeatDataCustomQueryCallable; + } + @Override public UnaryCallable listLocationsCallable() { return listLocationsCallable; 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 4fcf07d48333..495c7066fefc 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 @@ -2537,6 +2537,24 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.showcase.v1beta1.CustomBindingRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.showcase.v1beta1.CustomBindingRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.showcase.v1beta1.DeleteBlurbRequest", "queryAllDeclaredConstructors": true, diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java index d0b50ab4dffc..64791fe34ad3 100644 --- a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientHttpJsonTest.java @@ -328,6 +328,7 @@ public void repeatDataSimplePathTest() throws Exception { .setFBool(true) .setFBytes(ByteString.EMPTY) .setFChild(ComplianceDataChild.newBuilder().build()) + .setCustomPathField("customPathField-1920204956") .setPString("pString-1191954271") .setPInt32(-858673665) .setPSint32(-567522134) @@ -401,6 +402,7 @@ public void repeatDataSimplePathExceptionTest() throws Exception { .setFBool(true) .setFBytes(ByteString.EMPTY) .setFChild(ComplianceDataChild.newBuilder().build()) + .setCustomPathField("customPathField-1920204956") .setPString("pString-1191954271") .setPInt32(-858673665) .setPSint32(-567522134) @@ -477,6 +479,7 @@ public void repeatDataPathResourceTest() throws Exception { .setPContinent(Continent.forNumber(0)) .setPChild(ComplianceDataGrandchild.newBuilder().build()) .build()) + .setCustomPathField("customPathField-1920204956") .setPString("pString-1191954271") .setPInt32(-858673665) .setPSint32(-567522134) @@ -564,6 +567,7 @@ public void repeatDataPathResourceExceptionTest() throws Exception { .setPContinent(Continent.forNumber(0)) .setPChild(ComplianceDataGrandchild.newBuilder().build()) .build()) + .setCustomPathField("customPathField-1920204956") .setPString("pString-1191954271") .setPInt32(-858673665) .setPSint32(-567522134) @@ -640,6 +644,7 @@ public void repeatDataPathTrailingResourceTest() throws Exception { .setPContinent(Continent.forNumber(0)) .setPChild(ComplianceDataGrandchild.newBuilder().build()) .build()) + .setCustomPathField("customPathField-1920204956") .setPString("pString-1191954271") .setPInt32(-858673665) .setPSint32(-567522134) @@ -727,6 +732,7 @@ public void repeatDataPathTrailingResourceExceptionTest() throws Exception { .setPContinent(Continent.forNumber(0)) .setPChild(ComplianceDataGrandchild.newBuilder().build()) .build()) + .setCustomPathField("customPathField-1920204956") .setPString("pString-1191954271") .setPInt32(-858673665) .setPSint32(-567522134) @@ -995,6 +1001,251 @@ public void verifyEnumExceptionTest() throws Exception { } } + @Test + public void repeatDataCustomPathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-1477056489") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setCustomPathField("customPathField-8550") + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPSint32(-567522134) + .setPSfixed32(1566619631) + .setPUint32(-510263832) + .setPFixed32(942872580) + .setPInt64(-858673570) + .setPSint64(-567522039) + .setPSfixed64(1566619726) + .setPUint64(-510263737) + .setPFixed64(942872675) + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + + RepeatResponse actualResponse = client.repeatDataCustomPath(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 repeatDataCustomPathExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo( + ComplianceData.newBuilder() + .setFString("fString-1477056489") + .setFInt32(-1143775883) + .setFSint32(-815756300) + .setFSfixed32(-763212615) + .setFUint32(-758497998) + .setFFixed32(1837548026) + .setFInt64(-1143775788) + .setFSint64(-815756205) + .setFSfixed64(-763212520) + .setFUint64(-758497903) + .setFFixed64(1837548121) + .setFDouble(-1239459382) + .setFFloat(-1146609341) + .setFBool(true) + .setFBytes(ByteString.EMPTY) + .setFChild(ComplianceDataChild.newBuilder().build()) + .setCustomPathField("customPathField-8550") + .setPString("pString-1191954271") + .setPInt32(-858673665) + .setPSint32(-567522134) + .setPSfixed32(1566619631) + .setPUint32(-510263832) + .setPFixed32(942872580) + .setPInt64(-858673570) + .setPSint64(-567522039) + .setPSfixed64(1566619726) + .setPUint64(-510263737) + .setPFixed64(942872675) + .setPFloat(-861507123) + .setPDouble(-991225216) + .setPBool(true) + .setPChild(ComplianceDataChild.newBuilder().build()) + .build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + client.repeatDataCustomPath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyCustomMessageTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyCustomMessage(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 repeatDataBodyCustomMessageExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + client.repeatDataBodyCustomMessage(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataCustomQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockService.addResponse(expectedResponse); + + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + + RepeatResponse actualResponse = client.repeatDataCustomQuery(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 repeatDataCustomQueryExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + client.repeatDataCustomQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java index add5465c05eb..12fcc5e6dd78 100644 --- a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/ComplianceClientTest.java @@ -763,6 +763,177 @@ public void verifyEnumExceptionTest() throws Exception { } } + @Test + public void repeatDataCustomPathTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + + RepeatResponse actualResponse = client.repeatDataCustomPath(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CustomBindingRequest actualRequest = ((CustomBindingRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getCustomKebabName(), actualRequest.getCustomKebabName()); + Assert.assertEquals(request.getCustomBodyMessage(), actualRequest.getCustomBodyMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataCustomPathExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + client.repeatDataCustomPath(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataBodyCustomMessageTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + + RepeatResponse actualResponse = client.repeatDataBodyCustomMessage(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CustomBindingRequest actualRequest = ((CustomBindingRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getCustomKebabName(), actualRequest.getCustomKebabName()); + Assert.assertEquals(request.getCustomBodyMessage(), actualRequest.getCustomBodyMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataBodyCustomMessageExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + client.repeatDataBodyCustomMessage(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void repeatDataCustomQueryTest() throws Exception { + RepeatResponse expectedResponse = + RepeatResponse.newBuilder() + .setRequest(RepeatRequest.newBuilder().build()) + .setBindingUri("bindingUri1514820775") + .build(); + mockCompliance.addResponse(expectedResponse); + + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + + RepeatResponse actualResponse = client.repeatDataCustomQuery(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCompliance.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CustomBindingRequest actualRequest = ((CustomBindingRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getName(), actualRequest.getName()); + Assert.assertEquals(request.getInfo(), actualRequest.getInfo()); + Assert.assertEquals(request.getServerVerify(), actualRequest.getServerVerify()); + Assert.assertEquals(request.getCustomKebabName(), actualRequest.getCustomKebabName()); + Assert.assertEquals(request.getCustomBodyMessage(), actualRequest.getCustomBodyMessage()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void repeatDataCustomQueryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockCompliance.addException(exception); + + try { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + client.repeatDataCustomQuery(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + @Test public void listLocationsTest() throws Exception { Location responsesElement = Location.newBuilder().build(); diff --git a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java index 406660c72e56..50eb4d786fa5 100644 --- a/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java +++ b/java-showcase/gapic-showcase/src/test/java/com/google/showcase/v1beta1/MockComplianceImpl.java @@ -268,4 +268,70 @@ public void verifyEnum(EnumResponse request, StreamObserver respon Exception.class.getName()))); } } + + @Override + public void repeatDataCustomPath( + CustomBindingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RepeatDataCustomPath, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataBodyCustomMessage( + CustomBindingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RepeatDataBodyCustomMessage, expected" + + " %s or %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void repeatDataCustomQuery( + CustomBindingRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof RepeatResponse) { + requests.add(request); + responseObserver.onNext(((RepeatResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RepeatDataCustomQuery, expected %s or" + + " %s", + response == null ? "null" : response.getClass().getName(), + RepeatResponse.class.getName(), + Exception.class.getName()))); + } + } } 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 50d218cf7019..e6fb61b5cb74 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 @@ -462,6 +462,152 @@ private ComplianceGrpc() {} return getVerifyEnumMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataCustomPathMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataCustomPath", + requestType = com.google.showcase.v1beta1.CustomBindingRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataCustomPathMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataCustomPathMethod; + if ((getRepeatDataCustomPathMethod = ComplianceGrpc.getRepeatDataCustomPathMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataCustomPathMethod = ComplianceGrpc.getRepeatDataCustomPathMethod) + == null) { + ComplianceGrpc.getRepeatDataCustomPathMethod = + getRepeatDataCustomPathMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataCustomPath")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CustomBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataCustomPath")) + .build(); + } + } + } + return getRepeatDataCustomPathMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyCustomMessageMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataBodyCustomMessage", + requestType = com.google.showcase.v1beta1.CustomBindingRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyCustomMessageMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataBodyCustomMessageMethod; + if ((getRepeatDataBodyCustomMessageMethod = ComplianceGrpc.getRepeatDataBodyCustomMessageMethod) + == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataBodyCustomMessageMethod = + ComplianceGrpc.getRepeatDataBodyCustomMessageMethod) + == null) { + ComplianceGrpc.getRepeatDataBodyCustomMessageMethod = + getRepeatDataBodyCustomMessageMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataBodyCustomMessage")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CustomBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataBodyCustomMessage")) + .build(); + } + } + } + return getRepeatDataBodyCustomMessageMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataCustomQueryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "RepeatDataCustomQuery", + requestType = com.google.showcase.v1beta1.CustomBindingRequest.class, + responseType = com.google.showcase.v1beta1.RepeatResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataCustomQueryMethod() { + io.grpc.MethodDescriptor< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse> + getRepeatDataCustomQueryMethod; + if ((getRepeatDataCustomQueryMethod = ComplianceGrpc.getRepeatDataCustomQueryMethod) == null) { + synchronized (ComplianceGrpc.class) { + if ((getRepeatDataCustomQueryMethod = ComplianceGrpc.getRepeatDataCustomQueryMethod) + == null) { + ComplianceGrpc.getRepeatDataCustomQueryMethod = + getRepeatDataCustomQueryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "RepeatDataCustomQuery")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.CustomBindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.showcase.v1beta1.RepeatResponse.getDefaultInstance())) + .setSchemaDescriptor( + new ComplianceMethodDescriptorSupplier("RepeatDataCustomQuery")) + .build(); + } + } + } + return getRepeatDataCustomQueryMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static ComplianceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -677,6 +823,49 @@ default void verifyEnum( io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getVerifyEnumMethod(), responseObserver); } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending some parameters as path variables with custom json_name.
+     * 
+ */ + default void repeatDataCustomPath( + com.google.showcase.v1beta1.CustomBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataCustomPathMethod(), responseObserver); + } + + /** + * + * + *
+     * Testing custom json_name option in custom message bodies
+     * 
+ */ + default void repeatDataBodyCustomMessage( + com.google.showcase.v1beta1.CustomBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataBodyCustomMessageMethod(), responseObserver); + } + + /** + * + * + *
+     * Testing custom query parameter mapping with dashes
+     * 
+ */ + default void repeatDataCustomQuery( + com.google.showcase.v1beta1.CustomBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getRepeatDataCustomQueryMethod(), responseObserver); + } } /** @@ -884,6 +1073,55 @@ public void verifyEnum( io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request, responseObserver); } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending some parameters as path variables with custom json_name.
+     * 
+ */ + public void repeatDataCustomPath( + com.google.showcase.v1beta1.CustomBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataCustomPathMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Testing custom json_name option in custom message bodies
+     * 
+ */ + public void repeatDataBodyCustomMessage( + com.google.showcase.v1beta1.CustomBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataBodyCustomMessageMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Testing custom query parameter mapping with dashes
+     * 
+ */ + public void repeatDataCustomQuery( + com.google.showcase.v1beta1.CustomBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getRepeatDataCustomQueryMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -1050,6 +1288,46 @@ public com.google.showcase.v1beta1.EnumResponse verifyEnum( return io.grpc.stub.ClientCalls.blockingV2UnaryCall( getChannel(), getVerifyEnumMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending some parameters as path variables with custom json_name.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataCustomPath( + com.google.showcase.v1beta1.CustomBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataCustomPathMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Testing custom json_name option in custom message bodies
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyCustomMessage( + com.google.showcase.v1beta1.CustomBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataBodyCustomMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Testing custom query parameter mapping with dashes
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataCustomQuery( + com.google.showcase.v1beta1.CustomBindingRequest request) throws io.grpc.StatusException { + return io.grpc.stub.ClientCalls.blockingV2UnaryCall( + getChannel(), getRepeatDataCustomQueryMethod(), getCallOptions(), request); + } } /** @@ -1216,6 +1494,46 @@ public com.google.showcase.v1beta1.EnumResponse verifyEnum( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getVerifyEnumMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending some parameters as path variables with custom json_name.
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataCustomPath( + com.google.showcase.v1beta1.CustomBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataCustomPathMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Testing custom json_name option in custom message bodies
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataBodyCustomMessage( + com.google.showcase.v1beta1.CustomBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataBodyCustomMessageMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Testing custom query parameter mapping with dashes
+     * 
+ */ + public com.google.showcase.v1beta1.RepeatResponse repeatDataCustomQuery( + com.google.showcase.v1beta1.CustomBindingRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getRepeatDataCustomQueryMethod(), getCallOptions(), request); + } } /** @@ -1392,6 +1710,49 @@ protected ComplianceFutureStub build(io.grpc.Channel channel, io.grpc.CallOption return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getVerifyEnumMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * This method echoes the ComplianceData request. This method exercises
+     * sending some parameters as path variables with custom json_name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataCustomPath(com.google.showcase.v1beta1.CustomBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataCustomPathMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Testing custom json_name option in custom message bodies
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataBodyCustomMessage(com.google.showcase.v1beta1.CustomBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataBodyCustomMessageMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Testing custom query parameter mapping with dashes
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.showcase.v1beta1.RepeatResponse> + repeatDataCustomQuery(com.google.showcase.v1beta1.CustomBindingRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getRepeatDataCustomQueryMethod(), getCallOptions()), request); + } } private static final int METHODID_REPEAT_DATA_BODY = 0; @@ -1404,6 +1765,9 @@ protected ComplianceFutureStub build(io.grpc.Channel channel, io.grpc.CallOption private static final int METHODID_REPEAT_DATA_BODY_PATCH = 7; private static final int METHODID_GET_ENUM = 8; private static final int METHODID_VERIFY_ENUM = 9; + private static final int METHODID_REPEAT_DATA_CUSTOM_PATH = 10; + private static final int METHODID_REPEAT_DATA_BODY_CUSTOM_MESSAGE = 11; + private static final int METHODID_REPEAT_DATA_CUSTOM_QUERY = 12; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1482,6 +1846,24 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_REPEAT_DATA_CUSTOM_PATH: + serviceImpl.repeatDataCustomPath( + (com.google.showcase.v1beta1.CustomBindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_BODY_CUSTOM_MESSAGE: + serviceImpl.repeatDataBodyCustomMessage( + (com.google.showcase.v1beta1.CustomBindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_REPEAT_DATA_CUSTOM_QUERY: + serviceImpl.repeatDataCustomQuery( + (com.google.showcase.v1beta1.CustomBindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; default: throw new AssertionError(); } @@ -1568,6 +1950,27 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser new MethodHandlers< com.google.showcase.v1beta1.EnumResponse, com.google.showcase.v1beta1.EnumResponse>(service, METHODID_VERIFY_ENUM))) + .addMethod( + getRepeatDataCustomPathMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_CUSTOM_PATH))) + .addMethod( + getRepeatDataBodyCustomMessageMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_BODY_CUSTOM_MESSAGE))) + .addMethod( + getRepeatDataCustomQueryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.showcase.v1beta1.CustomBindingRequest, + com.google.showcase.v1beta1.RepeatResponse>( + service, METHODID_REPEAT_DATA_CUSTOM_QUERY))) .build(); } @@ -1629,6 +2032,9 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getRepeatDataBodyPatchMethod()) .addMethod(getGetEnumMethod()) .addMethod(getVerifyEnumMethod()) + .addMethod(getRepeatDataCustomPathMethod()) + .addMethod(getRepeatDataBodyCustomMessageMethod()) + .addMethod(getRepeatDataCustomQueryMethod()) .build(); } } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java index 51cf60cc0e29..b0685a7ceb95 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceData.java @@ -56,6 +56,7 @@ private ComplianceData() { fString_ = ""; fBytes_ = com.google.protobuf.ByteString.EMPTY; fKingdom_ = 0; + customPathField_ = ""; pString_ = ""; pKingdom_ = 0; } @@ -500,6 +501,47 @@ public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuild : fChild_; } + public static final int CUSTOM_PATH_FIELD_FIELD_NUMBER = 24; + + @SuppressWarnings("serial") + private volatile java.lang.Object customPathField_ = ""; + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return The customPathField. + */ + @java.lang.Override + public java.lang.String getCustomPathField() { + java.lang.Object ref = customPathField_; + 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(); + customPathField_ = s; + return s; + } + } + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return The bytes for customPathField. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomPathFieldBytes() { + java.lang.Object ref = customPathField_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customPathField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int P_STRING_FIELD_NUMBER = 17; @SuppressWarnings("serial") @@ -1005,6 +1047,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (((bitField0_ & 0x00008000) != 0)) { output.writeEnum(23, pKingdom_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(customPathField_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 24, customPathField_); + } if (((bitField0_ & 0x00000008) != 0)) { output.writeSInt32(39, pSint32_); } @@ -1115,6 +1160,9 @@ public int getSerializedSize() { if (((bitField0_ & 0x00008000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(23, pKingdom_); } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(customPathField_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(24, customPathField_); + } if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSInt32Size(39, pSint32_); } @@ -1183,6 +1231,7 @@ public boolean equals(final java.lang.Object obj) { if (hasFChild()) { if (!getFChild().equals(other.getFChild())) return false; } + if (!getCustomPathField().equals(other.getCustomPathField())) return false; if (hasPString() != other.hasPString()) return false; if (hasPString()) { if (!getPString().equals(other.getPString())) return false; @@ -1299,6 +1348,8 @@ public int hashCode() { hash = (37 * hash) + F_CHILD_FIELD_NUMBER; hash = (53 * hash) + getFChild().hashCode(); } + hash = (37 * hash) + CUSTOM_PATH_FIELD_FIELD_NUMBER; + hash = (53 * hash) + getCustomPathField().hashCode(); if (hasPString()) { hash = (37 * hash) + P_STRING_FIELD_NUMBER; hash = (53 * hash) + getPString().hashCode(); @@ -1539,6 +1590,7 @@ public Builder clear() { fChildBuilder_.dispose(); fChildBuilder_ = null; } + customPathField_ = ""; pString_ = ""; pInt32_ = 0; pSint32_ = 0; @@ -1652,65 +1704,64 @@ private void buildPartial0(com.google.showcase.v1beta1.ComplianceData result) { to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00020000) != 0)) { + result.customPathField_ = customPathField_; + } + if (((from_bitField0_ & 0x00040000) != 0)) { result.pString_ = pString_; to_bitField0_ |= 0x00000002; } - if (((from_bitField0_ & 0x00040000) != 0)) { + if (((from_bitField0_ & 0x00080000) != 0)) { result.pInt32_ = pInt32_; to_bitField0_ |= 0x00000004; } - if (((from_bitField0_ & 0x00080000) != 0)) { + if (((from_bitField0_ & 0x00100000) != 0)) { result.pSint32_ = pSint32_; to_bitField0_ |= 0x00000008; } - if (((from_bitField0_ & 0x00100000) != 0)) { + if (((from_bitField0_ & 0x00200000) != 0)) { result.pSfixed32_ = pSfixed32_; to_bitField0_ |= 0x00000010; } - if (((from_bitField0_ & 0x00200000) != 0)) { + if (((from_bitField0_ & 0x00400000) != 0)) { result.pUint32_ = pUint32_; to_bitField0_ |= 0x00000020; } - if (((from_bitField0_ & 0x00400000) != 0)) { + if (((from_bitField0_ & 0x00800000) != 0)) { result.pFixed32_ = pFixed32_; to_bitField0_ |= 0x00000040; } - if (((from_bitField0_ & 0x00800000) != 0)) { + if (((from_bitField0_ & 0x01000000) != 0)) { result.pInt64_ = pInt64_; to_bitField0_ |= 0x00000080; } - if (((from_bitField0_ & 0x01000000) != 0)) { + if (((from_bitField0_ & 0x02000000) != 0)) { result.pSint64_ = pSint64_; to_bitField0_ |= 0x00000100; } - if (((from_bitField0_ & 0x02000000) != 0)) { + if (((from_bitField0_ & 0x04000000) != 0)) { result.pSfixed64_ = pSfixed64_; to_bitField0_ |= 0x00000200; } - if (((from_bitField0_ & 0x04000000) != 0)) { + if (((from_bitField0_ & 0x08000000) != 0)) { result.pUint64_ = pUint64_; to_bitField0_ |= 0x00000400; } - if (((from_bitField0_ & 0x08000000) != 0)) { + if (((from_bitField0_ & 0x10000000) != 0)) { result.pFixed64_ = pFixed64_; to_bitField0_ |= 0x00000800; } - if (((from_bitField0_ & 0x10000000) != 0)) { + if (((from_bitField0_ & 0x20000000) != 0)) { result.pFloat_ = pFloat_; to_bitField0_ |= 0x00001000; } - if (((from_bitField0_ & 0x20000000) != 0)) { + if (((from_bitField0_ & 0x40000000) != 0)) { result.pDouble_ = pDouble_; to_bitField0_ |= 0x00002000; } - if (((from_bitField0_ & 0x40000000) != 0)) { + if (((from_bitField0_ & 0x80000000) != 0)) { result.pBool_ = pBool_; to_bitField0_ |= 0x00004000; } - if (((from_bitField0_ & 0x80000000) != 0)) { - result.pKingdom_ = pKingdom_; - to_bitField0_ |= 0x00008000; - } result.bitField0_ |= to_bitField0_; } @@ -1718,6 +1769,10 @@ private void buildPartial1(com.google.showcase.v1beta1.ComplianceData result) { int from_bitField1_ = bitField1_; int to_bitField0_ = 0; if (((from_bitField1_ & 0x00000001) != 0)) { + result.pKingdom_ = pKingdom_; + to_bitField0_ |= 0x00008000; + } + if (((from_bitField1_ & 0x00000002) != 0)) { result.pChild_ = pChildBuilder_ == null ? pChild_ : pChildBuilder_.build(); to_bitField0_ |= 0x00010000; } @@ -1789,9 +1844,14 @@ public Builder mergeFrom(com.google.showcase.v1beta1.ComplianceData other) { if (other.hasFChild()) { mergeFChild(other.getFChild()); } + if (!other.getCustomPathField().isEmpty()) { + customPathField_ = other.customPathField_; + bitField0_ |= 0x00020000; + onChanged(); + } if (other.hasPString()) { pString_ = other.pString_; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); } if (other.hasPInt32()) { @@ -1964,31 +2024,31 @@ public Builder mergeFrom( case 138: { pString_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; break; } // case 138 case 144: { pInt32_ = input.readInt32(); - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; break; } // case 144 case 153: { pDouble_ = input.readDouble(); - bitField0_ |= 0x20000000; + bitField0_ |= 0x40000000; break; } // case 153 case 160: { pBool_ = input.readBool(); - bitField0_ |= 0x40000000; + bitField0_ |= 0x80000000; break; } // case 160 case 170: { input.readMessage(internalGetPChildFieldBuilder().getBuilder(), extensionRegistry); - bitField1_ |= 0x00000001; + bitField1_ |= 0x00000002; break; } // case 170 case 176: @@ -2000,67 +2060,73 @@ public Builder mergeFrom( case 184: { pKingdom_ = input.readEnum(); - bitField0_ |= 0x80000000; + bitField1_ |= 0x00000001; break; } // case 184 + case 194: + { + customPathField_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00020000; + break; + } // case 194 case 312: { pSint32_ = input.readSInt32(); - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; break; } // case 312 case 325: { pSfixed32_ = input.readSFixed32(); - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; break; } // case 325 case 328: { pUint32_ = input.readUInt32(); - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; break; } // case 328 case 341: { pFixed32_ = input.readFixed32(); - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; break; } // case 341 case 344: { pInt64_ = input.readInt64(); - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; break; } // case 344 case 352: { pSint64_ = input.readSInt64(); - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; break; } // case 352 case 361: { pSfixed64_ = input.readSFixed64(); - bitField0_ |= 0x02000000; + bitField0_ |= 0x04000000; break; } // case 361 case 368: { pUint64_ = input.readUInt64(); - bitField0_ |= 0x04000000; + bitField0_ |= 0x08000000; break; } // case 368 case 377: { pFixed64_ = input.readFixed64(); - bitField0_ |= 0x08000000; + bitField0_ |= 0x10000000; break; } // case 377 case 389: { pFloat_ = input.readFloat(); - bitField0_ |= 0x10000000; + bitField0_ |= 0x20000000; break; } // case 389 default: @@ -2892,6 +2958,87 @@ public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuild return fChildBuilder_; } + private java.lang.Object customPathField_ = ""; + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return The customPathField. + */ + public java.lang.String getCustomPathField() { + java.lang.Object ref = customPathField_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customPathField_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return The bytes for customPathField. + */ + public com.google.protobuf.ByteString getCustomPathFieldBytes() { + java.lang.Object ref = customPathField_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customPathField_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @param value The customPathField to set. + * @return This builder for chaining. + */ + public Builder setCustomPathField(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customPathField_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return This builder for chaining. + */ + public Builder clearCustomPathField() { + customPathField_ = getDefaultInstance().getCustomPathField(); + bitField0_ = (bitField0_ & ~0x00020000); + onChanged(); + return this; + } + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @param value The bytes for customPathField to set. + * @return This builder for chaining. + */ + public Builder setCustomPathFieldBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customPathField_ = value; + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + private java.lang.Object pString_ = ""; /** @@ -2900,7 +3047,7 @@ public com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuild * @return Whether the pString field is set. */ public boolean hasPString() { - return ((bitField0_ & 0x00020000) != 0); + return ((bitField0_ & 0x00040000) != 0); } /** @@ -2948,7 +3095,7 @@ public Builder setPString(java.lang.String value) { throw new NullPointerException(); } pString_ = value; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -2960,7 +3107,7 @@ public Builder setPString(java.lang.String value) { */ public Builder clearPString() { pString_ = getDefaultInstance().getPString(); - bitField0_ = (bitField0_ & ~0x00020000); + bitField0_ = (bitField0_ & ~0x00040000); onChanged(); return this; } @@ -2977,7 +3124,7 @@ public Builder setPStringBytes(com.google.protobuf.ByteString value) { } checkByteStringIsUtf8(value); pString_ = value; - bitField0_ |= 0x00020000; + bitField0_ |= 0x00040000; onChanged(); return this; } @@ -2991,7 +3138,7 @@ public Builder setPStringBytes(com.google.protobuf.ByteString value) { */ @java.lang.Override public boolean hasPInt32() { - return ((bitField0_ & 0x00040000) != 0); + return ((bitField0_ & 0x00080000) != 0); } /** @@ -3013,7 +3160,7 @@ public int getPInt32() { public Builder setPInt32(int value) { pInt32_ = value; - bitField0_ |= 0x00040000; + bitField0_ |= 0x00080000; onChanged(); return this; } @@ -3024,7 +3171,7 @@ public Builder setPInt32(int value) { * @return This builder for chaining. */ public Builder clearPInt32() { - bitField0_ = (bitField0_ & ~0x00040000); + bitField0_ = (bitField0_ & ~0x00080000); pInt32_ = 0; onChanged(); return this; @@ -3039,7 +3186,7 @@ public Builder clearPInt32() { */ @java.lang.Override public boolean hasPSint32() { - return ((bitField0_ & 0x00080000) != 0); + return ((bitField0_ & 0x00100000) != 0); } /** @@ -3061,7 +3208,7 @@ public int getPSint32() { public Builder setPSint32(int value) { pSint32_ = value; - bitField0_ |= 0x00080000; + bitField0_ |= 0x00100000; onChanged(); return this; } @@ -3072,7 +3219,7 @@ public Builder setPSint32(int value) { * @return This builder for chaining. */ public Builder clearPSint32() { - bitField0_ = (bitField0_ & ~0x00080000); + bitField0_ = (bitField0_ & ~0x00100000); pSint32_ = 0; onChanged(); return this; @@ -3087,7 +3234,7 @@ public Builder clearPSint32() { */ @java.lang.Override public boolean hasPSfixed32() { - return ((bitField0_ & 0x00100000) != 0); + return ((bitField0_ & 0x00200000) != 0); } /** @@ -3109,7 +3256,7 @@ public int getPSfixed32() { public Builder setPSfixed32(int value) { pSfixed32_ = value; - bitField0_ |= 0x00100000; + bitField0_ |= 0x00200000; onChanged(); return this; } @@ -3120,7 +3267,7 @@ public Builder setPSfixed32(int value) { * @return This builder for chaining. */ public Builder clearPSfixed32() { - bitField0_ = (bitField0_ & ~0x00100000); + bitField0_ = (bitField0_ & ~0x00200000); pSfixed32_ = 0; onChanged(); return this; @@ -3135,7 +3282,7 @@ public Builder clearPSfixed32() { */ @java.lang.Override public boolean hasPUint32() { - return ((bitField0_ & 0x00200000) != 0); + return ((bitField0_ & 0x00400000) != 0); } /** @@ -3157,7 +3304,7 @@ public int getPUint32() { public Builder setPUint32(int value) { pUint32_ = value; - bitField0_ |= 0x00200000; + bitField0_ |= 0x00400000; onChanged(); return this; } @@ -3168,7 +3315,7 @@ public Builder setPUint32(int value) { * @return This builder for chaining. */ public Builder clearPUint32() { - bitField0_ = (bitField0_ & ~0x00200000); + bitField0_ = (bitField0_ & ~0x00400000); pUint32_ = 0; onChanged(); return this; @@ -3183,7 +3330,7 @@ public Builder clearPUint32() { */ @java.lang.Override public boolean hasPFixed32() { - return ((bitField0_ & 0x00400000) != 0); + return ((bitField0_ & 0x00800000) != 0); } /** @@ -3205,7 +3352,7 @@ public int getPFixed32() { public Builder setPFixed32(int value) { pFixed32_ = value; - bitField0_ |= 0x00400000; + bitField0_ |= 0x00800000; onChanged(); return this; } @@ -3216,7 +3363,7 @@ public Builder setPFixed32(int value) { * @return This builder for chaining. */ public Builder clearPFixed32() { - bitField0_ = (bitField0_ & ~0x00400000); + bitField0_ = (bitField0_ & ~0x00800000); pFixed32_ = 0; onChanged(); return this; @@ -3231,7 +3378,7 @@ public Builder clearPFixed32() { */ @java.lang.Override public boolean hasPInt64() { - return ((bitField0_ & 0x00800000) != 0); + return ((bitField0_ & 0x01000000) != 0); } /** @@ -3253,7 +3400,7 @@ public long getPInt64() { public Builder setPInt64(long value) { pInt64_ = value; - bitField0_ |= 0x00800000; + bitField0_ |= 0x01000000; onChanged(); return this; } @@ -3264,7 +3411,7 @@ public Builder setPInt64(long value) { * @return This builder for chaining. */ public Builder clearPInt64() { - bitField0_ = (bitField0_ & ~0x00800000); + bitField0_ = (bitField0_ & ~0x01000000); pInt64_ = 0L; onChanged(); return this; @@ -3279,7 +3426,7 @@ public Builder clearPInt64() { */ @java.lang.Override public boolean hasPSint64() { - return ((bitField0_ & 0x01000000) != 0); + return ((bitField0_ & 0x02000000) != 0); } /** @@ -3301,7 +3448,7 @@ public long getPSint64() { public Builder setPSint64(long value) { pSint64_ = value; - bitField0_ |= 0x01000000; + bitField0_ |= 0x02000000; onChanged(); return this; } @@ -3312,7 +3459,7 @@ public Builder setPSint64(long value) { * @return This builder for chaining. */ public Builder clearPSint64() { - bitField0_ = (bitField0_ & ~0x01000000); + bitField0_ = (bitField0_ & ~0x02000000); pSint64_ = 0L; onChanged(); return this; @@ -3327,7 +3474,7 @@ public Builder clearPSint64() { */ @java.lang.Override public boolean hasPSfixed64() { - return ((bitField0_ & 0x02000000) != 0); + return ((bitField0_ & 0x04000000) != 0); } /** @@ -3349,7 +3496,7 @@ public long getPSfixed64() { public Builder setPSfixed64(long value) { pSfixed64_ = value; - bitField0_ |= 0x02000000; + bitField0_ |= 0x04000000; onChanged(); return this; } @@ -3360,7 +3507,7 @@ public Builder setPSfixed64(long value) { * @return This builder for chaining. */ public Builder clearPSfixed64() { - bitField0_ = (bitField0_ & ~0x02000000); + bitField0_ = (bitField0_ & ~0x04000000); pSfixed64_ = 0L; onChanged(); return this; @@ -3375,7 +3522,7 @@ public Builder clearPSfixed64() { */ @java.lang.Override public boolean hasPUint64() { - return ((bitField0_ & 0x04000000) != 0); + return ((bitField0_ & 0x08000000) != 0); } /** @@ -3397,7 +3544,7 @@ public long getPUint64() { public Builder setPUint64(long value) { pUint64_ = value; - bitField0_ |= 0x04000000; + bitField0_ |= 0x08000000; onChanged(); return this; } @@ -3408,7 +3555,7 @@ public Builder setPUint64(long value) { * @return This builder for chaining. */ public Builder clearPUint64() { - bitField0_ = (bitField0_ & ~0x04000000); + bitField0_ = (bitField0_ & ~0x08000000); pUint64_ = 0L; onChanged(); return this; @@ -3423,7 +3570,7 @@ public Builder clearPUint64() { */ @java.lang.Override public boolean hasPFixed64() { - return ((bitField0_ & 0x08000000) != 0); + return ((bitField0_ & 0x10000000) != 0); } /** @@ -3445,7 +3592,7 @@ public long getPFixed64() { public Builder setPFixed64(long value) { pFixed64_ = value; - bitField0_ |= 0x08000000; + bitField0_ |= 0x10000000; onChanged(); return this; } @@ -3456,7 +3603,7 @@ public Builder setPFixed64(long value) { * @return This builder for chaining. */ public Builder clearPFixed64() { - bitField0_ = (bitField0_ & ~0x08000000); + bitField0_ = (bitField0_ & ~0x10000000); pFixed64_ = 0L; onChanged(); return this; @@ -3471,7 +3618,7 @@ public Builder clearPFixed64() { */ @java.lang.Override public boolean hasPFloat() { - return ((bitField0_ & 0x10000000) != 0); + return ((bitField0_ & 0x20000000) != 0); } /** @@ -3493,7 +3640,7 @@ public float getPFloat() { public Builder setPFloat(float value) { pFloat_ = value; - bitField0_ |= 0x10000000; + bitField0_ |= 0x20000000; onChanged(); return this; } @@ -3504,7 +3651,7 @@ public Builder setPFloat(float value) { * @return This builder for chaining. */ public Builder clearPFloat() { - bitField0_ = (bitField0_ & ~0x10000000); + bitField0_ = (bitField0_ & ~0x20000000); pFloat_ = 0F; onChanged(); return this; @@ -3519,7 +3666,7 @@ public Builder clearPFloat() { */ @java.lang.Override public boolean hasPDouble() { - return ((bitField0_ & 0x20000000) != 0); + return ((bitField0_ & 0x40000000) != 0); } /** @@ -3541,7 +3688,7 @@ public double getPDouble() { public Builder setPDouble(double value) { pDouble_ = value; - bitField0_ |= 0x20000000; + bitField0_ |= 0x40000000; onChanged(); return this; } @@ -3552,7 +3699,7 @@ public Builder setPDouble(double value) { * @return This builder for chaining. */ public Builder clearPDouble() { - bitField0_ = (bitField0_ & ~0x20000000); + bitField0_ = (bitField0_ & ~0x40000000); pDouble_ = 0D; onChanged(); return this; @@ -3567,7 +3714,7 @@ public Builder clearPDouble() { */ @java.lang.Override public boolean hasPBool() { - return ((bitField0_ & 0x40000000) != 0); + return ((bitField0_ & 0x80000000) != 0); } /** @@ -3589,7 +3736,7 @@ public boolean getPBool() { public Builder setPBool(boolean value) { pBool_ = value; - bitField0_ |= 0x40000000; + bitField0_ |= 0x80000000; onChanged(); return this; } @@ -3600,7 +3747,7 @@ public Builder setPBool(boolean value) { * @return This builder for chaining. */ public Builder clearPBool() { - bitField0_ = (bitField0_ & ~0x40000000); + bitField0_ = (bitField0_ & ~0x80000000); pBool_ = false; onChanged(); return this; @@ -3615,7 +3762,7 @@ public Builder clearPBool() { */ @java.lang.Override public boolean hasPKingdom() { - return ((bitField0_ & 0x80000000) != 0); + return ((bitField1_ & 0x00000001) != 0); } /** @@ -3636,7 +3783,7 @@ public int getPKingdomValue() { */ public Builder setPKingdomValue(int value) { pKingdom_ = value; - bitField0_ |= 0x80000000; + bitField1_ |= 0x00000001; onChanged(); return this; } @@ -3665,7 +3812,7 @@ public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdo if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x80000000; + bitField1_ |= 0x00000001; pKingdom_ = value.getNumber(); onChanged(); return this; @@ -3677,7 +3824,7 @@ public Builder setPKingdom(com.google.showcase.v1beta1.ComplianceData.LifeKingdo * @return This builder for chaining. */ public Builder clearPKingdom() { - bitField0_ = (bitField0_ & ~0x80000000); + bitField1_ = (bitField1_ & ~0x00000001); pKingdom_ = 0; onChanged(); return this; @@ -3696,7 +3843,7 @@ public Builder clearPKingdom() { * @return Whether the pChild field is set. */ public boolean hasPChild() { - return ((bitField1_ & 0x00000001) != 0); + return ((bitField1_ & 0x00000002) != 0); } /** @@ -3724,7 +3871,7 @@ public Builder setPChild(com.google.showcase.v1beta1.ComplianceDataChild value) } else { pChildBuilder_.setMessage(value); } - bitField1_ |= 0x00000001; + bitField1_ |= 0x00000002; onChanged(); return this; } @@ -3737,7 +3884,7 @@ public Builder setPChild( } else { pChildBuilder_.setMessage(builderForValue.build()); } - bitField1_ |= 0x00000001; + bitField1_ |= 0x00000002; onChanged(); return this; } @@ -3745,7 +3892,7 @@ public Builder setPChild( /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value) { if (pChildBuilder_ == null) { - if (((bitField1_ & 0x00000001) != 0) + if (((bitField1_ & 0x00000002) != 0) && pChild_ != null && pChild_ != com.google.showcase.v1beta1.ComplianceDataChild.getDefaultInstance()) { getPChildBuilder().mergeFrom(value); @@ -3756,7 +3903,7 @@ public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value pChildBuilder_.mergeFrom(value); } if (pChild_ != null) { - bitField1_ |= 0x00000001; + bitField1_ |= 0x00000002; onChanged(); } return this; @@ -3764,7 +3911,7 @@ public Builder mergePChild(com.google.showcase.v1beta1.ComplianceDataChild value /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ public Builder clearPChild() { - bitField1_ = (bitField1_ & ~0x00000001); + bitField1_ = (bitField1_ & ~0x00000002); pChild_ = null; if (pChildBuilder_ != null) { pChildBuilder_.dispose(); @@ -3776,7 +3923,7 @@ public Builder clearPChild() { /** optional .google.showcase.v1beta1.ComplianceDataChild p_child = 21; */ public com.google.showcase.v1beta1.ComplianceDataChild.Builder getPChildBuilder() { - bitField1_ |= 0x00000001; + bitField1_ |= 0x00000002; onChanged(); return internalGetPChildFieldBuilder().getBuilder(); } diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java index e419c8834951..c26ef008bcb2 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceDataOrBuilder.java @@ -169,6 +169,20 @@ public interface ComplianceDataOrBuilder /** .google.showcase.v1beta1.ComplianceDataChild f_child = 16; */ com.google.showcase.v1beta1.ComplianceDataChildOrBuilder getFChildOrBuilder(); + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return The customPathField. + */ + java.lang.String getCustomPathField(); + + /** + * string custom_path_field = 24 [json_name = "custom-path-field"]; + * + * @return The bytes for customPathField. + */ + com.google.protobuf.ByteString getCustomPathFieldBytes(); + /** * optional string p_string = 17; * diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java index 86fc02ea43b9..a37a1e372fb9 100644 --- a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/ComplianceOuterClass.java @@ -44,6 +44,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_showcase_v1beta1_RepeatRequest_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_google_showcase_v1beta1_RepeatRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_showcase_v1beta1_CustomBindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_google_showcase_v1beta1_CustomBindingRequest_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_showcase_v1beta1_RepeatResponse_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable @@ -104,7 +108,14 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\025_intended_binding_uriB\n\n" + "\010_p_int32B\n\n" + "\010_p_int64B\013\n" - + "\t_p_double\"^\n" + + "\t_p_double\"\373\001\n" + + "\024CustomBindingRequest\022\014\n" + + "\004name\030\001 \001(\t\0225\n" + + "\004info\030\002 \001(\0132\'.google.showcase.v1beta1.ComplianceData\022\025\n\r" + + "server_verify\030\003 \001(\010\022,\n" + + "\021custom_kebab_name\030\004 \001(\tR\021custom-kebab-name\022Y\n" + + "\023custom_body_message\030\005" + + " \001(\0132\'.google.showcase.v1beta1.ComplianceDataR\023custom-body-message\"^\n" + "\016RepeatResponse\0227\n" + "\007request\030\001 \001(\0132&.google.showcase.v1beta1.RepeatRequest\022\023\n" + "\013binding_uri\030\002 \001(\t\"J\n" @@ -113,7 +124,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017ComplianceGroup\022\014\n" + "\004name\030\001 \001(\t\022\014\n" + "\004rpcs\030\002 \003(\t\0228\n" - + "\010requests\030\003 \003(\0132&.google.showcase.v1beta1.RepeatRequest\"\320\t\n" + + "\010requests\030\003 \003(\0132&.google.showcase.v1beta1.RepeatRequest\"\376\t\n" + "\016ComplianceData\022\020\n" + "\010f_string\030\001 \001(\t\022\017\n" + "\007f_int32\030\002 \001(\005\022\020\n" @@ -133,9 +144,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + " \001(\002\022\016\n" + "\006f_bool\030\016 \001(\010\022\017\n" + "\007f_bytes\030\017 \001(\014\022F\n" - + "\tf_kingdom\030\026 \001(\016" - + "23.google.showcase.v1beta1.ComplianceData.LifeKingdom\022=\n" - + "\007f_child\030\020 \001(\0132,.google.showcase.v1beta1.ComplianceDataChild\022\025\n" + + "\tf_kingdom\030\026" + + " \001(\01623.google.showcase.v1beta1.ComplianceData.LifeKingdom\022=\n" + + "\007f_child\030\020 \001(\0132,.google.showcase.v1beta1.ComplianceDataChild\022,\n" + + "\021custom_path_field\030\030 \001(\tR\021custom-path-field\022\025\n" + "\010p_string\030\021 \001(\tH\000\210\001\001\022\024\n" + "\007p_int32\030\022 \001(\005H\001\210\001\001\022\025\n" + "\010p_sint32\030\' \001(\021H\002\210\001\001\022\027\n\n" @@ -153,10 +165,10 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010p_double\030\023 \001(\001H\014\210\001\001\022\023\n" + "\006p_bool\030\024 \001(\010H\r" + "\210\001\001\022K\n" - + "\tp_kingdom\030\027" - + " \001(\01623.google.showcase.v1beta1.ComplianceData.LifeKingdomH\016\210\001\001\022B\n" - + "\007p_child\030\025" - + " \001(\0132,.google.showcase.v1beta1.ComplianceDataChildH\017\210\001\001\"\203\001\n" + + "\tp_kingdom\030\027 \001(\01623" + + ".google.showcase.v1beta1.ComplianceData.LifeKingdomH\016\210\001\001\022B\n" + + "\007p_child\030\025 \001(\0132,.goog" + + "le.showcase.v1beta1.ComplianceDataChildH\017\210\001\001\"\203\001\n" + "\013LifeKingdom\022\034\n" + "\030LIFE_KINGDOM_UNSPECIFIED\020\000\022\022\n" + "\016ARCHAEBACTERIA\020\001\022\016\n\n" @@ -170,8 +182,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\t_p_sint32B\r\n" + "\013_p_sfixed32B\013\n" + "\t_p_uint32B\014\n\n" - + "_p_fixed32B\n" - + "\n" + + "_p_fixed32B\n\n" + "\010_p_int64B\013\n" + "\t_p_sint64B\r\n" + "\013_p_sfixed64B\013\n" @@ -188,8 +199,8 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\010f_double\030\003 \001(\001\022\016\n" + "\006f_bool\030\004 \001(\010\0227\n" + "\013f_continent\030\013 \001(\0162\".google.showcase.v1beta1.Continent\022B\n" - + "\007f_child\030\005" - + " \001(\01321.google.showcase.v1beta1.ComplianceDataGrandchild\022\025\n" + + "\007f_child\030\005 \001(\01321.goo" + + "gle.showcase.v1beta1.ComplianceDataGrandchild\022\025\n" + "\010p_string\030\006 \001(\tH\000\210\001\001\022\024\n" + "\007p_float\030\007 \001(\002H\001\210\001\001\022\025\n" + "\010p_double\030\010 \001(\001H\002\210\001\001\022\023\n" @@ -217,46 +228,54 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\007AMERICA\020\002\022\r\n" + "\tANTARTICA\020\003\022\r\n" + "\tAUSTRALIA\020\004\022\n\n" - + "\006EUROPE\020\0052\330\r\n\n" + + "\006EUROPE\020\0052\325\021\n\n" + "Compliance\022\202\001\n" - + "\016RepeatDataBody\022&.google.showcase.v1beta1.Repe" - + "atRequest\032\'.google.showcase.v1beta1.Repe" - + "atResponse\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n" - + "\022RepeatDataBodyInfo\022&.google.show" - + "case.v1beta1.RepeatRequest\032\'.google.showcase.v1beta1.RepeatResponse\"&\202\323\344\223\002" + + "\016RepeatDataBody\022&.google.showcase.v1beta1.RepeatRequest\032\'.google.s" + + "howcase.v1beta1.RepeatResponse\"\037\202\323\344\223\002\031\"\024/v1beta1/repeat:body:\001*\022\215\001\n" + + "\022RepeatDataBodyInfo\022&.google.showcase.v1beta1.RepeatR" + + "equest\032\'.google.showcase.v1beta1.RepeatResponse\"&\202\323\344\223\002" + " \"\030/v1beta1/repeat:bodyinfo:\004info\022\201\001\n" - + "\017RepeatDataQuery\022&.google.showcase.v1beta1.Repeat" - + "Request\032\'.google.showcase.v1beta1.Repeat" - + "Response\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n" - + "\024RepeatDataSimplePath\022&.google.showca" - + "se.v1beta1.RepeatRequest\032\'.google.showca" - + "se.v1beta1.RepeatResponse\"p\202\323\344\223\002j\022h/v1be" - + "ta1/repeat/{info.f_string}/{info.f_int32" - + "}/{info.f_double}/{info.f_bool}/{info.f_kingdom}:simplepath\022\323\002\n" - + "\026RepeatDataPathResource\022&.google.showcase.v1beta1.RepeatR" - + "equest\032\'.google.showcase.v1beta1.RepeatR" - + "esponse\"\347\001\202\323\344\223\002\340\001\022h/v1beta1/repeat/{info" - + ".f_string=first/*}/{info.f_child.f_string=second/*}/bool/{info.f_bool}:pathresou" - + "rceZt\022r/v1beta1/repeat/{info.f_child.f_string=first/*}/{info.f_string=second/*}/" - + "bool/{info.f_bool}:childfirstpathresource\022\331\001\n" - + "\036RepeatDataPathTrailingResource\022&.google.showcase.v1beta1.RepeatRequest\032\'.g" - + "oogle.showcase.v1beta1.RepeatResponse\"f\202" - + "\323\344\223\002`\022^/v1beta1/repeat/{info.f_string=fi" - + "rst/*}/{info.f_child.f_string=second/**}:pathtrailingresource\022\210\001\n" - + "\021RepeatDataBodyPut\022&.google.showcase.v1beta1.RepeatRequ" - + "est\032\'.google.showcase.v1beta1.RepeatResp" - + "onse\"\"\202\323\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n" - + "\023RepeatDataBodyPatch\022&.google.showcase.v1beta1.RepeatRequest\032\'.google.showca" - + "se.v1beta1.RepeatResponse\"$\202\323\344\223\002\0362\031/v1beta1/repeat:bodypatch:\001*\022x\n" - + "\007GetEnum\022$.goo" - + "gle.showcase.v1beta1.EnumRequest\032%.google.showcase.v1beta1.EnumResponse\"" + + "\017RepeatDataQuery\022&.google.showcase.v1beta1.RepeatRequest\032\'.google.sho" + + "wcase.v1beta1.RepeatResponse\"\035\202\323\344\223\002\027\022\025/v1beta1/repeat:query\022\331\001\n" + + "\024RepeatDataSimplePath\022&.google.showcase.v1beta1.RepeatReq" + + "uest\032\'.google.showcase.v1beta1.RepeatRes" + + "ponse\"p\202\323\344\223\002j\022h/v1beta1/repeat/{info.f_s" + + "tring}/{info.f_int32}/{info.f_double}/{i" + + "nfo.f_bool}/{info.f_kingdom}:simplepath\022\323\002\n" + + "\026RepeatDataPathResource\022&.google.show" + + "case.v1beta1.RepeatRequest\032\'.google.show" + + "case.v1beta1.RepeatResponse\"\347\001\202\323\344\223\002\340\001\022h/" + + "v1beta1/repeat/{info.f_string=first/*}/{info.f_child.f_string=second/*}/bool/{in" + + "fo.f_bool}:pathresourceZt\022r/v1beta1/repeat/{info.f_child.f_string=first/*}/{info" + + ".f_string=second/*}/bool/{info.f_bool}:childfirstpathresource\022\331\001\n" + + "\036RepeatDataPathTrailingResource\022&.google.showcase.v1bet" + + "a1.RepeatRequest\032\'.google.showcase.v1bet" + + "a1.RepeatResponse\"f\202\323\344\223\002`\022^/v1beta1/repe" + + "at/{info.f_string=first/*}/{info.f_child" + + ".f_string=second/**}:pathtrailingresource\022\210\001\n" + + "\021RepeatDataBodyPut\022&.google.showcase.v1beta1.RepeatRequest\032\'.google.showcas" + + "e.v1beta1.RepeatResponse\"\"\202\323\344\223\002\034\032\027/v1beta1/repeat:bodyput:\001*\022\214\001\n" + + "\023RepeatDataBodyPatch\022&.google.showcase.v1beta1.RepeatReq" + + "uest\032\'.google.showcase.v1beta1.RepeatRes" + + "ponse\"$\202\323\344\223\002\0362\031/v1beta1/repeat:bodypatch:\001*\022x\n" + + "\007GetEnum\022$.google.showcase.v1beta1" + + ".EnumRequest\032%.google.showcase.v1beta1.EnumResponse\"" + " \202\323\344\223\002\032\022\030/v1beta1/compliance/enum\022|\n\n" - + "VerifyEnum\022" - + "%.google.showcase.v1beta1.EnumResponse\032%.google.showcase.v1beta1.EnumResponse\"" - + " \202" - + "\323\344\223\002\032\"\030/v1beta1/compliance/enum\032\021\312A\016localhost:7469Bq\n" - + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapic-showcas" - + "e/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" + + "VerifyEnum\022%.google.showcase.v1" + + "beta1.EnumResponse\032%.google.showcase.v1beta1.EnumResponse\"" + + " \202\323\344\223\002\032\"\030/v1beta1/compliance/enum\022\253\001\n" + + "\024RepeatDataCustomPath\022-.google.showcase.v1beta1.CustomBindingRequ" + + "est\032\'.google.showcase.v1beta1.RepeatResp" + + "onse\";\202\323\344\223\0025\0223/v1beta1/repeat/{info.custom_path_field}:custompath\022\265\001\n" + + "\033RepeatDataBodyCustomMessage\022-.google.showcase.v1be" + + "ta1.CustomBindingRequest\032\'.google.showca" + + "se.v1beta1.RepeatResponse\">\202\323\344\223\0028\"!/v1be" + + "ta1/repeat:bodycustommessage:\023custom_body_message\022\224\001\n" + + "\025RepeatDataCustomQuery\022-.google.showcase.v1beta1.CustomBindingReque" + + "st\032\'.google.showcase.v1beta1.RepeatRespo" + + "nse\"#\202\323\344\223\002\035\022\033/v1beta1/repeat:customquery\032\021\312A\016localhost:7469Bq\n" + + "\033com.google.showcase.v1beta1P\001Z4github.com/googleapis/gapi" + + "c-showcase/server/genproto\352\002\031Google::Showcase::V1beta1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -282,8 +301,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PInt64", "PDouble", }); - internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = + internal_static_google_showcase_v1beta1_CustomBindingRequest_descriptor = getDescriptor().getMessageType(1); + internal_static_google_showcase_v1beta1_CustomBindingRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_google_showcase_v1beta1_CustomBindingRequest_descriptor, + new java.lang.String[] { + "Name", "Info", "ServerVerify", "CustomKebabName", "CustomBodyMessage", + }); + internal_static_google_showcase_v1beta1_RepeatResponse_descriptor = + getDescriptor().getMessageType(2); internal_static_google_showcase_v1beta1_RepeatResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_RepeatResponse_descriptor, @@ -291,7 +318,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Request", "BindingUri", }); internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor = - getDescriptor().getMessageType(2); + getDescriptor().getMessageType(3); internal_static_google_showcase_v1beta1_ComplianceSuite_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_ComplianceSuite_descriptor, @@ -299,7 +326,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Group", }); internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor = - getDescriptor().getMessageType(3); + getDescriptor().getMessageType(4); internal_static_google_showcase_v1beta1_ComplianceGroup_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_ComplianceGroup_descriptor, @@ -307,7 +334,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Name", "Rpcs", "Requests", }); internal_static_google_showcase_v1beta1_ComplianceData_descriptor = - getDescriptor().getMessageType(4); + getDescriptor().getMessageType(5); internal_static_google_showcase_v1beta1_ComplianceData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_ComplianceData_descriptor, @@ -329,6 +356,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FBytes", "FKingdom", "FChild", + "CustomPathField", "PString", "PInt32", "PSint32", @@ -347,7 +375,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PChild", }); internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor = - getDescriptor().getMessageType(5); + getDescriptor().getMessageType(6); internal_static_google_showcase_v1beta1_ComplianceDataChild_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_ComplianceDataChild_descriptor, @@ -366,7 +394,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "PChild", }); internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor = - getDescriptor().getMessageType(6); + getDescriptor().getMessageType(7); internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_ComplianceDataGrandchild_descriptor, @@ -374,7 +402,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FString", "FDouble", "FBool", }); internal_static_google_showcase_v1beta1_EnumRequest_descriptor = - getDescriptor().getMessageType(7); + getDescriptor().getMessageType(8); internal_static_google_showcase_v1beta1_EnumRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_EnumRequest_descriptor, @@ -382,7 +410,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "UnknownEnum", }); internal_static_google_showcase_v1beta1_EnumResponse_descriptor = - getDescriptor().getMessageType(8); + getDescriptor().getMessageType(9); internal_static_google_showcase_v1beta1_EnumResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_google_showcase_v1beta1_EnumResponse_descriptor, diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequest.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequest.java new file mode 100644 index 000000000000..483709a160bc --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequest.java @@ -0,0 +1,1223 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +/** Protobuf type {@code google.showcase.v1beta1.CustomBindingRequest} */ +@com.google.protobuf.Generated +public final class CustomBindingRequest extends com.google.protobuf.GeneratedMessage + implements + // @@protoc_insertion_point(message_implements:google.showcase.v1beta1.CustomBindingRequest) + CustomBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 33, + /* patch= */ 2, + /* suffix= */ "", + "CustomBindingRequest"); + } + + // Use CustomBindingRequest.newBuilder() to construct. + private CustomBindingRequest(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + + private CustomBindingRequest() { + name_ = ""; + customKebabName_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_CustomBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_CustomBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CustomBindingRequest.class, + com.google.showcase.v1beta1.CustomBindingRequest.Builder.class); + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INFO_FIELD_NUMBER = 2; + private com.google.showcase.v1beta1.ComplianceData info_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + @java.lang.Override + public boolean hasInfo() { + return ((bitField0_ & 0x00000001) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getInfo() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + return info_ == null ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() : info_; + } + + public static final int SERVER_VERIFY_FIELD_NUMBER = 3; + private boolean serverVerify_ = false; + + /** + * + * + *
+   * If true, the server will verify that the received request matches
+   * the request with the same name in the compliance test suite.
+   * 
+ * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + public static final int CUSTOM_KEBAB_NAME_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object customKebabName_ = ""; + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return The customKebabName. + */ + @java.lang.Override + public java.lang.String getCustomKebabName() { + java.lang.Object ref = customKebabName_; + 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(); + customKebabName_ = s; + return s; + } + } + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return The bytes for customKebabName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCustomKebabNameBytes() { + java.lang.Object ref = customKebabName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customKebabName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOM_BODY_MESSAGE_FIELD_NUMBER = 5; + private com.google.showcase.v1beta1.ComplianceData customBodyMessage_; + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + * + * @return Whether the customBodyMessage field is set. + */ + @java.lang.Override + public boolean hasCustomBodyMessage() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + * + * @return The customBodyMessage. + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceData getCustomBodyMessage() { + return customBodyMessage_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : customBodyMessage_; + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + @java.lang.Override + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getCustomBodyMessageOrBuilder() { + return customBodyMessage_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : customBodyMessage_; + } + + 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.GeneratedMessage.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getInfo()); + } + if (serverVerify_ != false) { + output.writeBool(3, serverVerify_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(customKebabName_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 4, customKebabName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(5, getCustomBodyMessage()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(name_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInfo()); + } + if (serverVerify_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, serverVerify_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(customKebabName_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(4, customKebabName_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getCustomBodyMessage()); + } + 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.CustomBindingRequest)) { + return super.equals(obj); + } + com.google.showcase.v1beta1.CustomBindingRequest other = + (com.google.showcase.v1beta1.CustomBindingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (hasInfo() != other.hasInfo()) return false; + if (hasInfo()) { + if (!getInfo().equals(other.getInfo())) return false; + } + if (getServerVerify() != other.getServerVerify()) return false; + if (!getCustomKebabName().equals(other.getCustomKebabName())) return false; + if (hasCustomBodyMessage() != other.hasCustomBodyMessage()) return false; + if (hasCustomBodyMessage()) { + if (!getCustomBodyMessage().equals(other.getCustomBodyMessage())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasInfo()) { + hash = (37 * hash) + INFO_FIELD_NUMBER; + hash = (53 * hash) + getInfo().hashCode(); + } + hash = (37 * hash) + SERVER_VERIFY_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getServerVerify()); + hash = (37 * hash) + CUSTOM_KEBAB_NAME_FIELD_NUMBER; + hash = (53 * hash) + getCustomKebabName().hashCode(); + if (hasCustomBodyMessage()) { + hash = (37 * hash) + CUSTOM_BODY_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getCustomBodyMessage().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest 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.CustomBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest 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.CustomBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage.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.CustomBindingRequest 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + + /** Protobuf type {@code google.showcase.v1beta1.CustomBindingRequest} */ + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder + implements + // @@protoc_insertion_point(builder_implements:google.showcase.v1beta1.CustomBindingRequest) + com.google.showcase.v1beta1.CustomBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_CustomBindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_CustomBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.showcase.v1beta1.CustomBindingRequest.class, + com.google.showcase.v1beta1.CustomBindingRequest.Builder.class); + } + + // Construct using com.google.showcase.v1beta1.CustomBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + internalGetInfoFieldBuilder(); + internalGetCustomBodyMessageFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + info_ = null; + if (infoBuilder_ != null) { + infoBuilder_.dispose(); + infoBuilder_ = null; + } + serverVerify_ = false; + customKebabName_ = ""; + customBodyMessage_ = null; + if (customBodyMessageBuilder_ != null) { + customBodyMessageBuilder_.dispose(); + customBodyMessageBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.showcase.v1beta1.ComplianceOuterClass + .internal_static_google_showcase_v1beta1_CustomBindingRequest_descriptor; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CustomBindingRequest getDefaultInstanceForType() { + return com.google.showcase.v1beta1.CustomBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.showcase.v1beta1.CustomBindingRequest build() { + com.google.showcase.v1beta1.CustomBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.showcase.v1beta1.CustomBindingRequest buildPartial() { + com.google.showcase.v1beta1.CustomBindingRequest result = + new com.google.showcase.v1beta1.CustomBindingRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.showcase.v1beta1.CustomBindingRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.info_ = infoBuilder_ == null ? info_ : infoBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.serverVerify_ = serverVerify_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.customKebabName_ = customKebabName_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.customBodyMessage_ = + customBodyMessageBuilder_ == null + ? customBodyMessage_ + : customBodyMessageBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.showcase.v1beta1.CustomBindingRequest) { + return mergeFrom((com.google.showcase.v1beta1.CustomBindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.showcase.v1beta1.CustomBindingRequest other) { + if (other == com.google.showcase.v1beta1.CustomBindingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasInfo()) { + mergeInfo(other.getInfo()); + } + if (other.getServerVerify() != false) { + setServerVerify(other.getServerVerify()); + } + if (!other.getCustomKebabName().isEmpty()) { + customKebabName_ = other.customKebabName_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasCustomBodyMessage()) { + mergeCustomBodyMessage(other.getCustomBodyMessage()); + } + 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: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(internalGetInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 24: + { + serverVerify_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 34: + { + customKebabName_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + input.readMessage( + internalGetCustomBodyMessageFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000010; + 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 java.lang.Object name_ = ""; + + /** + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceData info_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + infoBuilder_; + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + public boolean hasInfo() { + return ((bitField0_ & 0x00000002) != 0); + } + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + public com.google.showcase.v1beta1.ComplianceData getInfo() { + if (infoBuilder_ == null) { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } else { + return infoBuilder_.getMessage(); + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + } else { + infoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder setInfo(com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { + if (infoBuilder_ == null) { + info_ = builderForValue.build(); + } else { + infoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder mergeInfo(com.google.showcase.v1beta1.ComplianceData value) { + if (infoBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && info_ != null + && info_ != com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) { + getInfoBuilder().mergeFrom(value); + } else { + info_ = value; + } + } else { + infoBuilder_.mergeFrom(value); + } + if (info_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public Builder clearInfo() { + bitField0_ = (bitField0_ & ~0x00000002); + info_ = null; + if (infoBuilder_ != null) { + infoBuilder_.dispose(); + infoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceData.Builder getInfoBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return internalGetInfoFieldBuilder().getBuilder(); + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder() { + if (infoBuilder_ != null) { + return infoBuilder_.getMessageOrBuilder(); + } else { + return info_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : info_; + } + } + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + internalGetInfoFieldBuilder() { + if (infoBuilder_ == null) { + infoBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder>( + getInfo(), getParentForChildren(), isClean()); + info_ = null; + } + return infoBuilder_; + } + + private boolean serverVerify_; + + /** + * + * + *
+     * If true, the server will verify that the received request matches
+     * the request with the same name in the compliance test suite.
+     * 
+ * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + @java.lang.Override + public boolean getServerVerify() { + return serverVerify_; + } + + /** + * + * + *
+     * If true, the server will verify that the received request matches
+     * the request with the same name in the compliance test suite.
+     * 
+ * + * bool server_verify = 3; + * + * @param value The serverVerify to set. + * @return This builder for chaining. + */ + public Builder setServerVerify(boolean value) { + + serverVerify_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * + * + *
+     * If true, the server will verify that the received request matches
+     * the request with the same name in the compliance test suite.
+     * 
+ * + * bool server_verify = 3; + * + * @return This builder for chaining. + */ + public Builder clearServerVerify() { + bitField0_ = (bitField0_ & ~0x00000004); + serverVerify_ = false; + onChanged(); + return this; + } + + private java.lang.Object customKebabName_ = ""; + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return The customKebabName. + */ + public java.lang.String getCustomKebabName() { + java.lang.Object ref = customKebabName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + customKebabName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return The bytes for customKebabName. + */ + public com.google.protobuf.ByteString getCustomKebabNameBytes() { + java.lang.Object ref = customKebabName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + customKebabName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @param value The customKebabName to set. + * @return This builder for chaining. + */ + public Builder setCustomKebabName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + customKebabName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return This builder for chaining. + */ + public Builder clearCustomKebabName() { + customKebabName_ = getDefaultInstance().getCustomKebabName(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @param value The bytes for customKebabName to set. + * @return This builder for chaining. + */ + public Builder setCustomKebabNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + customKebabName_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private com.google.showcase.v1beta1.ComplianceData customBodyMessage_; + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + customBodyMessageBuilder_; + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + * + * @return Whether the customBodyMessage field is set. + */ + public boolean hasCustomBodyMessage() { + return ((bitField0_ & 0x00000010) != 0); + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + * + * @return The customBodyMessage. + */ + public com.google.showcase.v1beta1.ComplianceData getCustomBodyMessage() { + if (customBodyMessageBuilder_ == null) { + return customBodyMessage_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : customBodyMessage_; + } else { + return customBodyMessageBuilder_.getMessage(); + } + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + public Builder setCustomBodyMessage(com.google.showcase.v1beta1.ComplianceData value) { + if (customBodyMessageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customBodyMessage_ = value; + } else { + customBodyMessageBuilder_.setMessage(value); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + public Builder setCustomBodyMessage( + com.google.showcase.v1beta1.ComplianceData.Builder builderForValue) { + if (customBodyMessageBuilder_ == null) { + customBodyMessage_ = builderForValue.build(); + } else { + customBodyMessageBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + public Builder mergeCustomBodyMessage(com.google.showcase.v1beta1.ComplianceData value) { + if (customBodyMessageBuilder_ == null) { + if (((bitField0_ & 0x00000010) != 0) + && customBodyMessage_ != null + && customBodyMessage_ + != com.google.showcase.v1beta1.ComplianceData.getDefaultInstance()) { + getCustomBodyMessageBuilder().mergeFrom(value); + } else { + customBodyMessage_ = value; + } + } else { + customBodyMessageBuilder_.mergeFrom(value); + } + if (customBodyMessage_ != null) { + bitField0_ |= 0x00000010; + onChanged(); + } + return this; + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + public Builder clearCustomBodyMessage() { + bitField0_ = (bitField0_ & ~0x00000010); + customBodyMessage_ = null; + if (customBodyMessageBuilder_ != null) { + customBodyMessageBuilder_.dispose(); + customBodyMessageBuilder_ = null; + } + onChanged(); + return this; + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + public com.google.showcase.v1beta1.ComplianceData.Builder getCustomBodyMessageBuilder() { + bitField0_ |= 0x00000010; + onChanged(); + return internalGetCustomBodyMessageFieldBuilder().getBuilder(); + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + public com.google.showcase.v1beta1.ComplianceDataOrBuilder getCustomBodyMessageOrBuilder() { + if (customBodyMessageBuilder_ != null) { + return customBodyMessageBuilder_.getMessageOrBuilder(); + } else { + return customBodyMessage_ == null + ? com.google.showcase.v1beta1.ComplianceData.getDefaultInstance() + : customBodyMessage_; + } + } + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + private com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder> + internalGetCustomBodyMessageFieldBuilder() { + if (customBodyMessageBuilder_ == null) { + customBodyMessageBuilder_ = + new com.google.protobuf.SingleFieldBuilder< + com.google.showcase.v1beta1.ComplianceData, + com.google.showcase.v1beta1.ComplianceData.Builder, + com.google.showcase.v1beta1.ComplianceDataOrBuilder>( + getCustomBodyMessage(), getParentForChildren(), isClean()); + customBodyMessage_ = null; + } + return customBodyMessageBuilder_; + } + + // @@protoc_insertion_point(builder_scope:google.showcase.v1beta1.CustomBindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.showcase.v1beta1.CustomBindingRequest) + private static final com.google.showcase.v1beta1.CustomBindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.showcase.v1beta1.CustomBindingRequest(); + } + + public static com.google.showcase.v1beta1.CustomBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomBindingRequest 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.CustomBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequestOrBuilder.java b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequestOrBuilder.java new file mode 100644 index 000000000000..2cf6d312febf --- /dev/null +++ b/java-showcase/proto-gapic-showcase-v1beta1/src/main/java/com/google/showcase/v1beta1/CustomBindingRequestOrBuilder.java @@ -0,0 +1,112 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: schema/google/showcase/v1beta1/compliance.proto +// Protobuf Java Version: 4.33.2 + +package com.google.showcase.v1beta1; + +@com.google.protobuf.Generated +public interface CustomBindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.showcase.v1beta1.CustomBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + + /** + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return Whether the info field is set. + */ + boolean hasInfo(); + + /** + * .google.showcase.v1beta1.ComplianceData info = 2; + * + * @return The info. + */ + com.google.showcase.v1beta1.ComplianceData getInfo(); + + /** .google.showcase.v1beta1.ComplianceData info = 2; */ + com.google.showcase.v1beta1.ComplianceDataOrBuilder getInfoOrBuilder(); + + /** + * + * + *
+   * If true, the server will verify that the received request matches
+   * the request with the same name in the compliance test suite.
+   * 
+ * + * bool server_verify = 3; + * + * @return The serverVerify. + */ + boolean getServerVerify(); + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return The customKebabName. + */ + java.lang.String getCustomKebabName(); + + /** + * string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + * + * @return The bytes for customKebabName. + */ + com.google.protobuf.ByteString getCustomKebabNameBytes(); + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + * + * @return Whether the customBodyMessage field is set. + */ + boolean hasCustomBodyMessage(); + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + * + * @return The customBodyMessage. + */ + com.google.showcase.v1beta1.ComplianceData getCustomBodyMessage(); + + /** + * + * .google.showcase.v1beta1.ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; + * + */ + com.google.showcase.v1beta1.ComplianceDataOrBuilder getCustomBodyMessageOrBuilder(); +} 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 48c71bbb9b1d..b06ae1fb8fb2 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 @@ -125,6 +125,29 @@ service Compliance { }; } + // This method echoes the ComplianceData request. This method exercises + // sending some parameters as path variables with custom json_name. + rpc RepeatDataCustomPath(CustomBindingRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat/{info.custom_path_field}:custompath" + }; + } + + // Testing custom json_name option in custom message bodies + rpc RepeatDataBodyCustomMessage(CustomBindingRequest) returns (RepeatResponse) { + option (google.api.http) = { + post: "/v1beta1/repeat:bodycustommessage" + body: "custom_body_message" + }; + } + + // Testing custom query parameter mapping with dashes + rpc RepeatDataCustomQuery(CustomBindingRequest) returns (RepeatResponse) { + option (google.api.http) = { + get: "/v1beta1/repeat:customquery" + }; + } + } message RepeatRequest { @@ -149,6 +172,18 @@ message RepeatRequest { optional double p_double = 9; } +message CustomBindingRequest { + string name = 1; + ComplianceData info = 2; + + // If true, the server will verify that the received request matches + // the request with the same name in the compliance test suite. + bool server_verify = 3; + + string custom_kebab_name = 4 [json_name = "custom-kebab-name"]; + ComplianceData custom_body_message = 5 [json_name = "custom-body-message"]; +} + message RepeatResponse { RepeatRequest request = 1; @@ -212,6 +247,7 @@ message ComplianceData { LifeKingdom f_kingdom = 22; ComplianceDataChild f_child = 16; + string custom_path_field = 24 [json_name = "custom-path-field"]; // optional fields diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/AsyncRepeatDataBodyCustomMessage.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/AsyncRepeatDataBodyCustomMessage.java new file mode 100644 index 000000000000..6f4c01cc55c1 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/AsyncRepeatDataBodyCustomMessage.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyCustomMessage_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.CustomBindingRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataBodyCustomMessage { + + public static void main(String[] args) throws Exception { + asyncRepeatDataBodyCustomMessage(); + } + + public static void asyncRepeatDataBodyCustomMessage() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + ApiFuture future = + complianceClient.repeatDataBodyCustomMessageCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyCustomMessage_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/SyncRepeatDataBodyCustomMessage.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/SyncRepeatDataBodyCustomMessage.java new file mode 100644 index 000000000000..dfa841fca7c5 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatabodycustommessage/SyncRepeatDataBodyCustomMessage.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataBodyCustomMessage_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.CustomBindingRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataBodyCustomMessage { + + public static void main(String[] args) throws Exception { + syncRepeatDataBodyCustomMessage(); + } + + public static void syncRepeatDataBodyCustomMessage() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + RepeatResponse response = complianceClient.repeatDataBodyCustomMessage(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataBodyCustomMessage_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/AsyncRepeatDataCustomPath.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/AsyncRepeatDataCustomPath.java new file mode 100644 index 000000000000..413aa2c4adfb --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/AsyncRepeatDataCustomPath.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataCustomPath_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.CustomBindingRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataCustomPath { + + public static void main(String[] args) throws Exception { + asyncRepeatDataCustomPath(); + } + + public static void asyncRepeatDataCustomPath() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + ApiFuture future = + complianceClient.repeatDataCustomPathCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataCustomPath_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/SyncRepeatDataCustomPath.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/SyncRepeatDataCustomPath.java new file mode 100644 index 000000000000..0a06e606f949 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustompath/SyncRepeatDataCustomPath.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataCustomPath_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.CustomBindingRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataCustomPath { + + public static void main(String[] args) throws Exception { + syncRepeatDataCustomPath(); + } + + public static void syncRepeatDataCustomPath() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + RepeatResponse response = complianceClient.repeatDataCustomPath(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataCustomPath_sync] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/AsyncRepeatDataCustomQuery.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/AsyncRepeatDataCustomQuery.java new file mode 100644 index 000000000000..3bfd13c80f99 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/AsyncRepeatDataCustomQuery.java @@ -0,0 +1,54 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataCustomQuery_async] +import com.google.api.core.ApiFuture; +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.CustomBindingRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class AsyncRepeatDataCustomQuery { + + public static void main(String[] args) throws Exception { + asyncRepeatDataCustomQuery(); + } + + public static void asyncRepeatDataCustomQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + ApiFuture future = + complianceClient.repeatDataCustomQueryCallable().futureCall(request); + // Do something. + RepeatResponse response = future.get(); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataCustomQuery_async] diff --git a/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/SyncRepeatDataCustomQuery.java b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/SyncRepeatDataCustomQuery.java new file mode 100644 index 000000000000..449bdff766b8 --- /dev/null +++ b/java-showcase/samples/snippets/generated/com/google/showcase/v1beta1/compliance/repeatdatacustomquery/SyncRepeatDataCustomQuery.java @@ -0,0 +1,50 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.showcase.v1beta1.samples; + +// [START localhost7469_v1beta1_generated_Compliance_RepeatDataCustomQuery_sync] +import com.google.showcase.v1beta1.ComplianceClient; +import com.google.showcase.v1beta1.ComplianceData; +import com.google.showcase.v1beta1.CustomBindingRequest; +import com.google.showcase.v1beta1.RepeatResponse; + +public class SyncRepeatDataCustomQuery { + + public static void main(String[] args) throws Exception { + syncRepeatDataCustomQuery(); + } + + public static void syncRepeatDataCustomQuery() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (ComplianceClient complianceClient = ComplianceClient.create()) { + CustomBindingRequest request = + CustomBindingRequest.newBuilder() + .setName("name3373707") + .setInfo(ComplianceData.newBuilder().build()) + .setServerVerify(true) + .setCustomKebabName("customKebabName-2062111197") + .setCustomBodyMessage(ComplianceData.newBuilder().build()) + .build(); + RepeatResponse response = complianceClient.repeatDataCustomQuery(request); + } + } +} +// [END localhost7469_v1beta1_generated_Compliance_RepeatDataCustomQuery_sync]