======================= EchoClient ======================= + * + *
Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. + * + *
Sample for EchoClient: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (EchoClient echoClient = EchoClient.create()) { + * EchoResponse response = echoClient.echo(); + * } + * }+ */ +@Generated("by gapic-generator-java") +package com.google.showcase.v1beta1; + +import javax.annotation.Generated; diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java index 7270a2f14b..c6249121e5 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/GrpcTestProtoLoader.java @@ -18,6 +18,7 @@ import com.google.api.generator.gapic.model.Transport; public class GrpcTestProtoLoader extends TestProtoLoader { + private static final GrpcTestProtoLoader INSTANCE = new GrpcTestProtoLoader(); protected GrpcTestProtoLoader() { diff --git a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClient.golden b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClient.golden index 5d60b70463..5bc547af78 100644 --- a/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClient.golden +++ b/src/test/java/com/google/api/generator/gapic/composer/grpc/goldens/EchoClient.golden @@ -30,8 +30,13 @@ import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS. /** - * This class provides the ability to make remote calls to the backing service through method calls - * that map to API methods. Sample code to get started: + * Service Description: This service is used showcase the four main types of rpcs - unary, server + * side streaming, client side streaming, and bidirectional streaming. This service also exposes + * methods that explicitly implement server delay, and paginated calls. Set the 'showcase-trailer' + * metadata key on any method to have the values echoed in the response trailers. + * + *
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: * *
{@code * // This snippet has been automatically generated and should be regarded as a code template only. diff --git a/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java b/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java new file mode 100644 index 0000000000..8f562de47c --- /dev/null +++ b/src/test/java/com/google/api/generator/gapic/composer/utils/CommentFormatterTest.java @@ -0,0 +1,96 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.api.generator.gapic.composer.utils; + +import static org.junit.Assert.assertEquals; + +import com.google.api.generator.testutils.LineFormatter; +import org.junit.Test; + +public class CommentFormatterTest { + private static final String SERVICE_DESCRIPTION_HEADER_PATTERN = "Service Description: %s"; + + @Test + public void parseCommentWithItemizedList_paragraphContainsList() { + String protobufComment = + LineFormatter.lines( + "Service Name\n\n", + "One line initial description. Here is a list of items:\n", + " * This is item one\n", + " * This is item two"); + String result = CommentFormatter.formatAsJavaDocComment(protobufComment, null); + String expectedJavaDocComment = + LineFormatter.lines( + "Service Name\n", + "
One line initial description. Here is a list of items:\n", + "
Paragraphs starting with list items should still be parsed as list:\n", + "
Service Description: Service Name\n", + "
Here is a list of items:\n", + "
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataBody(request); + * } + * }+ * + *
Note: close() needs to be called on the ComplianceClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of ComplianceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * ComplianceSettings complianceSettings = + * ComplianceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * ComplianceSettings complianceSettings = + * ComplianceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * ComplianceSettings complianceSettings = ComplianceSettings.newHttpJsonBuilder().build(); + * ComplianceClient complianceClient = ComplianceClient.create(complianceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceClient implements BackgroundResource { + private final ComplianceSettings settings; + private final ComplianceStub stub; + + /** Constructs an instance of ComplianceClient with default settings. */ + public static final ComplianceClient create() throws IOException { + return create(ComplianceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ComplianceClient, using the given settings. The channels are created + * based on the settings passed in, or defaults for any settings that are not set. + */ + public static final ComplianceClient create(ComplianceSettings settings) throws IOException { + return new ComplianceClient(settings); + } + + /** + * Constructs an instance of ComplianceClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ComplianceSettings). + */ + public static final ComplianceClient create(ComplianceStub stub) { + return new ComplianceClient(stub); + } + + /** + * Constructs an instance of ComplianceClient, using the given settings. This is protected so that + * it is easy to make a subclass, but otherwise, the static factory methods should be preferred. + */ + protected ComplianceClient(ComplianceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ComplianceStubSettings) settings.getStubSettings()).createStub(); + } + + protected ComplianceClient(ComplianceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ComplianceSettings getSettings() { + return settings; + } + + public ComplianceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataBody(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataBody(RepeatRequest request) { + return repeatDataBodyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the entire request + * object in the REST body. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataBodyCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataBodyInfo(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataBodyInfo(RepeatRequest request) { + return repeatDataBodyInfoCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending the a message-type + * field in the REST body. Per AIP-127, only top-level, non-repeated fields can be sent this way. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataBodyInfoCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataQuery(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataQuery(RepeatRequest request) { + return repeatDataQueryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending all request fields + * as query parameters. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataQueryCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataSimplePath(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataSimplePath(RepeatRequest request) { + return repeatDataSimplePathCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request. This method exercises sending some parameters as + * "simple" path variables (i.e., of the form "/bar/{foo}" rather than "/{foo=bar/*}"), and + * the rest as query parameters. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataSimplePathCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataPathResource(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataPathResource(RepeatRequest request) { + return repeatDataPathResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a path resource. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataPathResourceCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataPathTrailingResource(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataPathTrailingResource(RepeatRequest request) { + return repeatDataPathTrailingResourceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Same as RepeatDataSimplePath, but with a trailing resource. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataPathTrailingResourceCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataBodyPut(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataBodyPut(RepeatRequest request) { + return repeatDataBodyPutCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PUT method. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataBodyPutCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * RepeatResponse response = complianceClient.repeatDataBodyPatch(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final RepeatResponse repeatDataBodyPatch(RepeatRequest request) { + return repeatDataBodyPatchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method echoes the ComplianceData request, using the HTTP PATCH method. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * RepeatRequest request = + * RepeatRequest.newBuilder() + * .setName("name3373707") + * .setInfo(ComplianceData.newBuilder().build()) + * .setServerVerify(true) + * .setIntendedBindingUri("intendedBindingUri780142386") + * .setFInt32(-1143775883) + * .setFInt64(-1143775788) + * .setFDouble(-1239459382) + * .setPInt32(-858673665) + * .setPInt64(-858673570) + * .setPDouble(-991225216) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * complianceClient.repeatDataBodyPatchCallable().futureCall(request); + * // Do something. + * RepeatResponse response = future.get(); + * } + * }
The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + * EnumResponse response = complianceClient.getEnum(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EnumResponse getEnum(EnumRequest request) { + return getEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method requests an enum value from the server. Depending on the contents of EnumRequest, + * the enum value returned will be a known enum declared in the .proto file, or a made-up enum + * value the is unknown to the client. To verify that clients can round-trip unknown enum vaues + * they receive, use the response from this RPC as the request to VerifyEnum() + * + *
The values of enums sent by the server when a known or unknown value is requested will be + * the same within a single Showcase server run (this is needed for VerifyEnum() to work) but are + * not guaranteed to be the same across separate Showcase server runs. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * EnumRequest request = EnumRequest.newBuilder().setUnknownEnum(true).build(); + * ApiFuture+ */ + public final UnaryCallablefuture = complianceClient.getEnumCallable().futureCall(request); + * // Do something. + * EnumResponse response = future.get(); + * } + * }
This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * EnumResponse request = + * EnumResponse.newBuilder() + * .setRequest(EnumRequest.newBuilder().build()) + * .setContinent(Continent.forNumber(0)) + * .build(); + * EnumResponse response = complianceClient.verifyEnum(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final EnumResponse verifyEnum(EnumResponse request) { + return verifyEnumCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * This method is used to verify that clients can round-trip enum values, which is particularly + * important for unknown enum values over REST. VerifyEnum() verifies that its request, which is + * presumably the response that the client previously got to a GetEnum(), contains the correct + * data. If so, it responds with the same EnumResponse; otherwise, the RPC errors. + * + *
This works because the values of enums sent by the server when a known or unknown value is + * requested will be the same within a single Showcase server run, although they are not + * guaranteed to be the same across separate Showcase server runs. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (ComplianceClient complianceClient = ComplianceClient.create()) { + * EnumResponse request = + * EnumResponse.newBuilder() + * .setRequest(EnumRequest.newBuilder().build()) + * .setContinent(Continent.forNumber(0)) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = complianceClient.verifyEnumCallable().futureCall(request); + * // Do something. + * EnumResponse response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of repeatDataBody to 30 seconds: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * ComplianceSettings.Builder complianceSettingsBuilder = ComplianceSettings.newBuilder(); + * complianceSettingsBuilder + * .repeatDataBodySettings() + * .setRetrySettings( + * complianceSettingsBuilder + * .repeatDataBodySettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ComplianceSettings complianceSettings = complianceSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ComplianceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class provides the ability to make remote calls to the backing service through method
+ * calls that map to API methods. Sample code to get started:
+ *
+ * Note: close() needs to be called on the EchoClient object to clean up resources such as
+ * threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ * The surface of this class includes several types of Java methods for each of the API's
+ * methods:
+ *
+ * See the individual methods for example code.
+ *
+ * Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ * This class can be customized by passing in a custom instance of EchoSettings to create(). For
+ * example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class EchoClient implements BackgroundResource {
+ private final EchoSettings settings;
+ private final EchoStub stub;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
+
+ /** Constructs an instance of EchoClient with default settings. */
+ public static final EchoClient create() throws IOException {
+ return create(EchoSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of EchoClient, using the given settings. The channels are created based
+ * on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final EchoClient create(EchoSettings settings) throws IOException {
+ return new EchoClient(settings);
+ }
+
+ /**
+ * Constructs an instance of EchoClient, using the given stub for making calls. This is for
+ * advanced usage - prefer using create(EchoSettings).
+ */
+ public static final EchoClient create(EchoStub stub) {
+ return new EchoClient(stub);
+ }
+
+ /**
+ * Constructs an instance of EchoClient, using the given settings. This is protected so that it is
+ * easy to make a subclass, but otherwise, the static factory methods should be preferred.
+ */
+ protected EchoClient(EchoSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((EchoStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
+ }
+
+ protected EchoClient(EchoStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
+ }
+
+ public final EchoSettings getSettings() {
+ return settings;
+ }
+
+ public EchoStub getStub() {
+ return stub;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ public final com.google.longrunning.OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * This method simply echoes the request. This method showcases unary RPCs.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of echo to 30 seconds:
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * EchoRequest request =
+ * EchoRequest.newBuilder()
+ * .setSeverity(Severity.forNumber(0))
+ * .setHeader("header-1221270899")
+ * .setOtherHeader("otherHeader-2026585667")
+ * .build();
+ * EchoResponse response = echoClient.echo(request);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings echoSettings =
+ * EchoSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * EchoClient echoClient = EchoClient.create(echoSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings echoSettings = EchoSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * EchoClient echoClient = EchoClient.create(echoSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings echoSettings = EchoSettings.newHttpJsonBuilder().build();
+ * EchoClient echoClient = EchoClient.create(echoSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * EchoRequest request =
+ * EchoRequest.newBuilder()
+ * .setSeverity(Severity.forNumber(0))
+ * .setHeader("header-1221270899")
+ * .setOtherHeader("otherHeader-2026585667")
+ * .build();
+ * EchoResponse response = echoClient.echo(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final EchoResponse echo(EchoRequest request) {
+ return echoCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * This method simply echoes the request. This method showcases unary RPCs.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * EchoRequest request =
+ * EchoRequest.newBuilder()
+ * .setSeverity(Severity.forNumber(0))
+ * .setHeader("header-1221270899")
+ * .setOtherHeader("otherHeader-2026585667")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * ExpandRequest request =
+ * ExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setError(Status.newBuilder().build())
+ * .build();
+ * ServerStream
+ */
+ public final ServerStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * ApiStreamObserver
+ */
+ public final ClientStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * BidiStream
+ */
+ public final BidiStreamingCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandRequest request =
+ * PagedExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (EchoResponse element : echoClient.pagedExpand(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PagedExpandPagedResponse pagedExpand(PagedExpandRequest request) {
+ return pagedExpandPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * This is similar to the Expand method but instead of returning a stream of expanded words, this
+ * method returns a paged list of expanded words.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandRequest request =
+ * PagedExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandRequest request =
+ * PagedExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * PagedExpandResponse response = echoClient.pagedExpandCallable().call(request);
+ * for (EchoResponse element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandLegacyRequest request =
+ * PagedExpandLegacyRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setMaxResults(1128457243)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * PagedExpandResponse response = echoClient.pagedExpandLegacy(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PagedExpandResponse pagedExpandLegacy(PagedExpandLegacyRequest request) {
+ return pagedExpandLegacyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * This is similar to the PagedExpand except that it uses max_results instead of page_size, as
+ * some legacy APIs still do. New APIs should NOT use this pattern.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandLegacyRequest request =
+ * PagedExpandLegacyRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setMaxResults(1128457243)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandRequest request =
+ * PagedExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Map.Entry
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PagedExpandLegacyMappedPagedResponse pagedExpandLegacyMapped(
+ PagedExpandRequest request) {
+ return pagedExpandLegacyMappedPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * This method returns a map containing lists of words that appear in the input, keyed by their
+ * initial character. The only words returned are the ones included in the current page, as
+ * determined by page_token and page_size, which both refer to the word indices in the input. This
+ * paging result consisting of a map of lists is a pattern used by some legacy APIs. New APIs
+ * should NOT use this pattern.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandRequest request =
+ * PagedExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * PagedExpandRequest request =
+ * PagedExpandRequest.newBuilder()
+ * .setContent("content951530617")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * PagedExpandLegacyMappedResponse response =
+ * echoClient.pagedExpandLegacyMappedCallable().call(request);
+ * for (Map.Entry
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * WaitRequest request = WaitRequest.newBuilder().build();
+ * WaitResponse response = echoClient.waitAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * WaitRequest request = WaitRequest.newBuilder().build();
+ * OperationFuture
+ */
+ public final OperationCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * WaitRequest request = WaitRequest.newBuilder().build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * BlockRequest request =
+ * BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
+ * BlockResponse response = echoClient.block(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final BlockResponse block(BlockRequest request) {
+ return blockCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * This method will block (wait) for the requested amount of time and then return the response or
+ * error. This method showcases how a client handles delays or retries.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (EchoClient echoClient = EchoClient.create()) {
+ * BlockRequest request =
+ * BlockRequest.newBuilder().setResponseDelay(Duration.newBuilder().build()).build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * EchoSettings.Builder echoSettingsBuilder = EchoSettings.newBuilder();
+ * echoSettingsBuilder
+ * .echoSettings()
+ * .setRetrySettings(
+ * echoSettingsBuilder
+ * .echoSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * EchoSettings echoSettings = echoSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class EchoSettings extends ClientSettings