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 (SpeechClient speechClient = SpeechClient.create()) { + * RecognizerName name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]"); + * Recognizer response = speechClient.getRecognizer(name); + * } + * }+ * + *
Note: close() needs to be called on the SpeechClient 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 SpeechSettings 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 + * SpeechSettings speechSettings = + * SpeechSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * SpeechClient speechClient = SpeechClient.create(speechSettings); + * }+ * + *
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 + * SpeechSettings speechSettings = SpeechSettings.newBuilder().setEndpoint(myEndpoint).build(); + * SpeechClient speechClient = SpeechClient.create(speechSettings); + * }+ * + *
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 + * SpeechSettings speechSettings = + * SpeechSettings.newBuilder() + * .setTransportChannelProvider( + * SpeechSettings.defaultHttpJsonTransportProviderBuilder().build()) + * .build(); + * SpeechClient speechClient = SpeechClient.create(speechSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class SpeechClient implements BackgroundResource { + private final SpeechSettings settings; + private final SpeechStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of SpeechClient with default settings. */ + public static final SpeechClient create() throws IOException { + return create(SpeechSettings.newBuilder().build()); + } + + /** + * Constructs an instance of SpeechClient, 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 SpeechClient create(SpeechSettings settings) throws IOException { + return new SpeechClient(settings); + } + + /** + * Constructs an instance of SpeechClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(SpeechSettings). + */ + public static final SpeechClient create(SpeechStub stub) { + return new SpeechClient(stub); + } + + /** + * Constructs an instance of SpeechClient, 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 SpeechClient(SpeechSettings settings) throws IOException { + this.settings = settings; + this.stub = ((SpeechStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected SpeechClient(SpeechStub 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 SpeechSettings getSettings() { + return settings; + } + + public SpeechStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Recognizer][google.cloud.speech.v2.Recognizer]. + * + *
Sample code: + * + *
{@code + * // This snippet has been automatically generated and should be regarded as a code template only. + * // It will require modifications to work: + * // - It may require correct/in-range values for request initialization. + * // - It may require specifying regional endpoints when creating the service client as shown in + * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + * try (SpeechClient speechClient = SpeechClient.create()) { + * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + * Recognizer recognizer = Recognizer.newBuilder().build(); + * String recognizerId = "recognizerId771963359"; + * Recognizer response = + * speechClient.createRecognizerAsync(parent, recognizer, recognizerId).get(); + * } + * }+ * + * @param parent Required. The project and location where this Recognizer will be created. The + * expected format is `projects/{project}/locations/{location}`. + * @param recognizer Required. The Recognizer to create. + * @param recognizerId The ID to use for the Recognizer, which will become the final component of + * the Recognizer's resource name. + *
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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 Recognizer's `name` field is used to identify the Recognizer to update. Format:
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @param updateMask The list of fields to update. If empty, all non-default valued fields are
+ * considered for update. Use `*` to update the entire Recognizer resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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:
+ *
+ * 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 config's `name` field is used to identify the config to be updated. The expected
+ * format is `projects/{project}/locations/{location}/config`.
+ * @param updateMask The list of fields to be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Config updateConfig(Config config, FieldMask updateMask) {
+ UpdateConfigRequest request =
+ UpdateConfigRequest.newBuilder().setConfig(config).setUpdateMask(updateMask).build();
+ return updateConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the [Config][google.cloud.speech.v2.Config].
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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 CustomClass's `name` field is used to identify the CustomClass to update. Format:
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`.
+ * @param updateMask The list of fields to be updated. If empty, all fields are considered for
+ * update.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture Sample code:
+ *
+ * This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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 PhraseSet's `name` field is used to identify the PhraseSet to update. Format:
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
+ * @param updateMask The list of fields to update. If empty, all non-default valued fields are
+ * considered for update. Use `*` to update the entire PhraseSet resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture 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 getRecognizer to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= SpeechClient =======================
+ *
+ * Service Description: Enables speech transcription and resource management.
+ *
+ * Sample for SpeechClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSpeechCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcSpeechStub extends SpeechStub {
+ private static final MethodDescriptor{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Recognizer recognizer = Recognizer.newBuilder().build();
+ * String recognizerId = "recognizerId771963359";
+ * Recognizer response =
+ * speechClient.createRecognizerAsync(parent, recognizer, recognizerId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project and location where this Recognizer will be created. The
+ * expected format is `projects/{project}/locations/{location}`.
+ * @param recognizer Required. The Recognizer to create.
+ * @param recognizerId The ID to use for the Recognizer, which will become the final component of
+ * the Recognizer's resource name.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * CreateRecognizerRequest request =
+ * CreateRecognizerRequest.newBuilder()
+ * .setRecognizer(Recognizer.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setRecognizerId("recognizerId771963359")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * Recognizer response = speechClient.createRecognizerAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CreateRecognizerRequest request =
+ * CreateRecognizerRequest.newBuilder()
+ * .setRecognizer(Recognizer.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setRecognizerId("recognizerId771963359")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CreateRecognizerRequest request =
+ * CreateRecognizerRequest.newBuilder()
+ * .setRecognizer(Recognizer.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setRecognizerId("recognizerId771963359")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Recognizer element : speechClient.listRecognizers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location of Recognizers to list. The expected format is
+ * `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListRecognizersPagedResponse listRecognizers(LocationName parent) {
+ ListRecognizersRequest request =
+ ListRecognizersRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listRecognizers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Recognizers.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Recognizer element : speechClient.listRecognizers(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location of Recognizers to list. The expected format is
+ * `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListRecognizersPagedResponse listRecognizers(String parent) {
+ ListRecognizersRequest request = ListRecognizersRequest.newBuilder().setParent(parent).build();
+ return listRecognizers(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Recognizers.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * ListRecognizersRequest request =
+ * ListRecognizersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (Recognizer element : speechClient.listRecognizers(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 ListRecognizersPagedResponse listRecognizers(ListRecognizersRequest request) {
+ return listRecognizersPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists Recognizers.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * ListRecognizersRequest request =
+ * ListRecognizersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * ListRecognizersRequest request =
+ * ListRecognizersRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListRecognizersResponse response = speechClient.listRecognizersCallable().call(request);
+ * for (Recognizer element : response.getRecognizersList()) {
+ * // 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 (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * Recognizer response = speechClient.getRecognizer(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Recognizer to retrieve. The expected format is
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Recognizer getRecognizer(RecognizerName name) {
+ GetRecognizerRequest request =
+ GetRecognizerRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getRecognizer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
+ * [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString();
+ * Recognizer response = speechClient.getRecognizer(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the Recognizer to retrieve. The expected format is
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Recognizer getRecognizer(String name) {
+ GetRecognizerRequest request = GetRecognizerRequest.newBuilder().setName(name).build();
+ return getRecognizer(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
+ * [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetRecognizerRequest request =
+ * GetRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .build();
+ * Recognizer response = speechClient.getRecognizer(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 Recognizer getRecognizer(GetRecognizerRequest request) {
+ return getRecognizerCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
+ * [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't exist.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetRecognizerRequest request =
+ * GetRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * Recognizer recognizer = Recognizer.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Recognizer response = speechClient.updateRecognizerAsync(recognizer, updateMask).get();
+ * }
+ * }
+ *
+ * @param recognizer Required. The Recognizer to update.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateRecognizerRequest request =
+ * UpdateRecognizerRequest.newBuilder()
+ * .setRecognizer(Recognizer.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .build();
+ * Recognizer response = speechClient.updateRecognizerAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateRecognizerRequest request =
+ * UpdateRecognizerRequest.newBuilder()
+ * .setRecognizer(Recognizer.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateRecognizerRequest request =
+ * UpdateRecognizerRequest.newBuilder()
+ * .setRecognizer(Recognizer.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * Recognizer response = speechClient.deleteRecognizerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Recognizer to delete. Format:
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString();
+ * Recognizer response = speechClient.deleteRecognizerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Recognizer to delete. Format:
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeleteRecognizerRequest request =
+ * DeleteRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * Recognizer response = speechClient.deleteRecognizerAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeleteRecognizerRequest request =
+ * DeleteRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeleteRecognizerRequest request =
+ * DeleteRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * Recognizer response = speechClient.undeleteRecognizerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Recognizer to undelete. Format:
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString();
+ * Recognizer response = speechClient.undeleteRecognizerAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the Recognizer to undelete. Format:
+ * `projects/{project}/locations/{location}/recognizers/{recognizer}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeleteRecognizerRequest request =
+ * UndeleteRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * Recognizer response = speechClient.undeleteRecognizerAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeleteRecognizerRequest request =
+ * UndeleteRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeleteRecognizerRequest request =
+ * UndeleteRecognizerRequest.newBuilder()
+ * .setName(RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName recognizer = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ * FieldMask configMask = FieldMask.newBuilder().build();
+ * ByteString content = ByteString.EMPTY;
+ * RecognizeResponse response = speechClient.recognize(recognizer, config, configMask, content);
+ * }
+ * }
+ *
+ * @param recognizer Required. The name of the Recognizer to use during recognition. The expected
+ * format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @param config Features and audio metadata to use for the Automatic Speech Recognition. This
+ * field in combination with the
+ * [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
+ * override parts of the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the Recognizer resource.
+ * @param configMask The list of fields in
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] that override the values in the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the recognizer during this recognition request. If no mask is provided, all non-default
+ * valued fields in [config][google.cloud.speech.v2.RecognizeRequest.config] override the
+ * values in the recognizer for this recognition request. If a mask is provided, only the
+ * fields listed in the mask override the config in the recognizer for this recognition
+ * request. If a wildcard (`*`) is provided,
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] completely overrides and replaces
+ * the config in the recognizer for this recognition request.
+ * @param content The audio data bytes encoded as specified in
+ * [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. As with all bytes fields,
+ * proto buffers use a pure binary representation, whereas JSON representations use base64.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RecognizeResponse recognize(
+ RecognizerName recognizer,
+ RecognitionConfig config,
+ FieldMask configMask,
+ ByteString content) {
+ RecognizeRequest request =
+ RecognizeRequest.newBuilder()
+ .setRecognizer(recognizer == null ? null : recognizer.toString())
+ .setConfig(config)
+ .setConfigMask(configMask)
+ .setContent(content)
+ .build();
+ return recognize(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Performs synchronous Speech recognition: receive results after all audio has been sent and
+ * processed.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName recognizer = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ * FieldMask configMask = FieldMask.newBuilder().build();
+ * String uri = "uri116076";
+ * RecognizeResponse response = speechClient.recognize(recognizer, config, configMask, uri);
+ * }
+ * }
+ *
+ * @param recognizer Required. The name of the Recognizer to use during recognition. The expected
+ * format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @param config Features and audio metadata to use for the Automatic Speech Recognition. This
+ * field in combination with the
+ * [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
+ * override parts of the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the Recognizer resource.
+ * @param configMask The list of fields in
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] that override the values in the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the recognizer during this recognition request. If no mask is provided, all non-default
+ * valued fields in [config][google.cloud.speech.v2.RecognizeRequest.config] override the
+ * values in the recognizer for this recognition request. If a mask is provided, only the
+ * fields listed in the mask override the config in the recognizer for this recognition
+ * request. If a wildcard (`*`) is provided,
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] completely overrides and replaces
+ * the config in the recognizer for this recognition request.
+ * @param uri URI that points to a file that contains audio data bytes as specified in
+ * [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. The file must not be
+ * compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported,
+ * which must be specified in the following format: `gs://bucket_name/object_name` (other URI
+ * formats return [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information,
+ * see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RecognizeResponse recognize(
+ RecognizerName recognizer, RecognitionConfig config, FieldMask configMask, String uri) {
+ RecognizeRequest request =
+ RecognizeRequest.newBuilder()
+ .setRecognizer(recognizer == null ? null : recognizer.toString())
+ .setConfig(config)
+ .setConfigMask(configMask)
+ .setUri(uri)
+ .build();
+ return recognize(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Performs synchronous Speech recognition: receive results after all audio has been sent and
+ * processed.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String recognizer = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString();
+ * RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ * FieldMask configMask = FieldMask.newBuilder().build();
+ * ByteString content = ByteString.EMPTY;
+ * RecognizeResponse response = speechClient.recognize(recognizer, config, configMask, content);
+ * }
+ * }
+ *
+ * @param recognizer Required. The name of the Recognizer to use during recognition. The expected
+ * format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @param config Features and audio metadata to use for the Automatic Speech Recognition. This
+ * field in combination with the
+ * [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
+ * override parts of the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the Recognizer resource.
+ * @param configMask The list of fields in
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] that override the values in the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the recognizer during this recognition request. If no mask is provided, all non-default
+ * valued fields in [config][google.cloud.speech.v2.RecognizeRequest.config] override the
+ * values in the recognizer for this recognition request. If a mask is provided, only the
+ * fields listed in the mask override the config in the recognizer for this recognition
+ * request. If a wildcard (`*`) is provided,
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] completely overrides and replaces
+ * the config in the recognizer for this recognition request.
+ * @param content The audio data bytes encoded as specified in
+ * [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. As with all bytes fields,
+ * proto buffers use a pure binary representation, whereas JSON representations use base64.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RecognizeResponse recognize(
+ String recognizer, RecognitionConfig config, FieldMask configMask, ByteString content) {
+ RecognizeRequest request =
+ RecognizeRequest.newBuilder()
+ .setRecognizer(recognizer)
+ .setConfig(config)
+ .setConfigMask(configMask)
+ .setContent(content)
+ .build();
+ return recognize(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Performs synchronous Speech recognition: receive results after all audio has been sent and
+ * processed.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String recognizer = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString();
+ * RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ * FieldMask configMask = FieldMask.newBuilder().build();
+ * String uri = "uri116076";
+ * RecognizeResponse response = speechClient.recognize(recognizer, config, configMask, uri);
+ * }
+ * }
+ *
+ * @param recognizer Required. The name of the Recognizer to use during recognition. The expected
+ * format is `projects/{project}/locations/{location}/recognizers/{recognizer}`.
+ * @param config Features and audio metadata to use for the Automatic Speech Recognition. This
+ * field in combination with the
+ * [config_mask][google.cloud.speech.v2.RecognizeRequest.config_mask] field can be used to
+ * override parts of the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the Recognizer resource.
+ * @param configMask The list of fields in
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] that override the values in the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the recognizer during this recognition request. If no mask is provided, all non-default
+ * valued fields in [config][google.cloud.speech.v2.RecognizeRequest.config] override the
+ * values in the recognizer for this recognition request. If a mask is provided, only the
+ * fields listed in the mask override the config in the recognizer for this recognition
+ * request. If a wildcard (`*`) is provided,
+ * [config][google.cloud.speech.v2.RecognizeRequest.config] completely overrides and replaces
+ * the config in the recognizer for this recognition request.
+ * @param uri URI that points to a file that contains audio data bytes as specified in
+ * [RecognitionConfig][google.cloud.speech.v2.RecognitionConfig]. The file must not be
+ * compressed (for example, gzip). Currently, only Google Cloud Storage URIs are supported,
+ * which must be specified in the following format: `gs://bucket_name/object_name` (other URI
+ * formats return [INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information,
+ * see [Request URIs](https://cloud.google.com/storage/docs/reference-uris).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final RecognizeResponse recognize(
+ String recognizer, RecognitionConfig config, FieldMask configMask, String uri) {
+ RecognizeRequest request =
+ RecognizeRequest.newBuilder()
+ .setRecognizer(recognizer)
+ .setConfig(config)
+ .setConfigMask(configMask)
+ .setUri(uri)
+ .build();
+ return recognize(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Performs synchronous Speech recognition: receive results after all audio has been sent and
+ * processed.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizeRequest request =
+ * RecognizeRequest.newBuilder()
+ * .setRecognizer(
+ * RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setConfig(RecognitionConfig.newBuilder().build())
+ * .setConfigMask(FieldMask.newBuilder().build())
+ * .build();
+ * RecognizeResponse response = speechClient.recognize(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 RecognizeResponse recognize(RecognizeRequest request) {
+ return recognizeCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Performs synchronous Speech recognition: receive results after all audio has been sent and
+ * processed.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizeRequest request =
+ * RecognizeRequest.newBuilder()
+ * .setRecognizer(
+ * RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setConfig(RecognitionConfig.newBuilder().build())
+ * .setConfigMask(FieldMask.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
+ * try (SpeechClient speechClient = SpeechClient.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 (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName recognizer = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ * FieldMask configMask = FieldMask.newBuilder().build();
+ * List
+ *
+ * @param recognizer Required. Resource name of the recognizer to be used for ASR.
+ * @param config Features and audio metadata to use for the Automatic Speech Recognition. This
+ * field in combination with the
+ * [config_mask][google.cloud.speech.v2.BatchRecognizeRequest.config_mask] field can be used
+ * to override parts of the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the Recognizer resource.
+ * @param configMask The list of fields in
+ * [config][google.cloud.speech.v2.BatchRecognizeRequest.config] that override the values in
+ * the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the recognizer during this recognition request. If no mask is provided, all given fields
+ * in [config][google.cloud.speech.v2.BatchRecognizeRequest.config] override the values in the
+ * recognizer for this recognition request. If a mask is provided, only the fields listed in
+ * the mask override the config in the recognizer for this recognition request. If a wildcard
+ * (`*`) is provided, [config][google.cloud.speech.v2.BatchRecognizeRequest.config]
+ * completely overrides and replaces the config in the recognizer for this recognition
+ * request.
+ * @param files Audio files with file metadata for ASR.
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String recognizer = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString();
+ * RecognitionConfig config = RecognitionConfig.newBuilder().build();
+ * FieldMask configMask = FieldMask.newBuilder().build();
+ * List
+ *
+ * @param recognizer Required. Resource name of the recognizer to be used for ASR.
+ * @param config Features and audio metadata to use for the Automatic Speech Recognition. This
+ * field in combination with the
+ * [config_mask][google.cloud.speech.v2.BatchRecognizeRequest.config_mask] field can be used
+ * to override parts of the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the Recognizer resource.
+ * @param configMask The list of fields in
+ * [config][google.cloud.speech.v2.BatchRecognizeRequest.config] that override the values in
+ * the
+ * [default_recognition_config][google.cloud.speech.v2.Recognizer.default_recognition_config]
+ * of the recognizer during this recognition request. If no mask is provided, all given fields
+ * in [config][google.cloud.speech.v2.BatchRecognizeRequest.config] override the values in the
+ * recognizer for this recognition request. If a mask is provided, only the fields listed in
+ * the mask override the config in the recognizer for this recognition request. If a wildcard
+ * (`*`) is provided, [config][google.cloud.speech.v2.BatchRecognizeRequest.config]
+ * completely overrides and replaces the config in the recognizer for this recognition
+ * request.
+ * @param files Audio files with file metadata for ASR.
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * BatchRecognizeRequest request =
+ * BatchRecognizeRequest.newBuilder()
+ * .setRecognizer(
+ * RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setConfig(RecognitionConfig.newBuilder().build())
+ * .setConfigMask(FieldMask.newBuilder().build())
+ * .addAllFiles(new ArrayList
+ *
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * BatchRecognizeRequest request =
+ * BatchRecognizeRequest.newBuilder()
+ * .setRecognizer(
+ * RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setConfig(RecognitionConfig.newBuilder().build())
+ * .setConfigMask(FieldMask.newBuilder().build())
+ * .addAllFiles(new ArrayList
+ */
+ 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 (SpeechClient speechClient = SpeechClient.create()) {
+ * BatchRecognizeRequest request =
+ * BatchRecognizeRequest.newBuilder()
+ * .setRecognizer(
+ * RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]").toString())
+ * .setConfig(RecognitionConfig.newBuilder().build())
+ * .setConfigMask(FieldMask.newBuilder().build())
+ * .addAllFiles(new ArrayList
+ */
+ 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 (SpeechClient speechClient = SpeechClient.create()) {
+ * ConfigName name = ConfigName.of("[PROJECT]", "[LOCATION]");
+ * Config response = speechClient.getConfig(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the config to retrieve. There is exactly one config resource
+ * per project per location. The expected format is
+ * `projects/{project}/locations/{location}/config`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Config getConfig(ConfigName name) {
+ GetConfigRequest request =
+ GetConfigRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [Config][google.cloud.speech.v2.Config].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = ConfigName.of("[PROJECT]", "[LOCATION]").toString();
+ * Config response = speechClient.getConfig(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the config to retrieve. There is exactly one config resource
+ * per project per location. The expected format is
+ * `projects/{project}/locations/{location}/config`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Config getConfig(String name) {
+ GetConfigRequest request = GetConfigRequest.newBuilder().setName(name).build();
+ return getConfig(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [Config][google.cloud.speech.v2.Config].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetConfigRequest request =
+ * GetConfigRequest.newBuilder()
+ * .setName(ConfigName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * Config response = speechClient.getConfig(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 Config getConfig(GetConfigRequest request) {
+ return getConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [Config][google.cloud.speech.v2.Config].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetConfigRequest request =
+ * GetConfigRequest.newBuilder()
+ * .setName(ConfigName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * Config config = Config.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Config response = speechClient.updateConfig(config, updateMask);
+ * }
+ * }
+ *
+ * @param config Required. The config to update.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateConfigRequest request =
+ * UpdateConfigRequest.newBuilder()
+ * .setConfig(Config.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Config response = speechClient.updateConfig(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 Config updateConfig(UpdateConfigRequest request) {
+ return updateConfigCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the [Config][google.cloud.speech.v2.Config].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateConfigRequest request =
+ * UpdateConfigRequest.newBuilder()
+ * .setConfig(Config.newBuilder().build())
+ * .setUpdateMask(FieldMask.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
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * CustomClass customClass = CustomClass.newBuilder().build();
+ * String customClassId = "customClassId1871032322";
+ * CustomClass response =
+ * speechClient.createCustomClassAsync(parent, customClass, customClassId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project and location where this CustomClass will be created. The
+ * expected format is `projects/{project}/locations/{location}`.
+ * @param customClass Required. The CustomClass to create.
+ * @param customClassId The ID to use for the CustomClass, which will become the final component
+ * of the CustomClass's resource name.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * CustomClass customClass = CustomClass.newBuilder().build();
+ * String customClassId = "customClassId1871032322";
+ * CustomClass response =
+ * speechClient.createCustomClassAsync(parent, customClass, customClassId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project and location where this CustomClass will be created. The
+ * expected format is `projects/{project}/locations/{location}`.
+ * @param customClass Required. The CustomClass to create.
+ * @param customClassId The ID to use for the CustomClass, which will become the final component
+ * of the CustomClass's resource name.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * CreateCustomClassRequest request =
+ * CreateCustomClassRequest.newBuilder()
+ * .setCustomClass(CustomClass.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setCustomClassId("customClassId1871032322")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * CustomClass response = speechClient.createCustomClassAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CreateCustomClassRequest request =
+ * CreateCustomClassRequest.newBuilder()
+ * .setCustomClass(CustomClass.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setCustomClassId("customClassId1871032322")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CreateCustomClassRequest request =
+ * CreateCustomClassRequest.newBuilder()
+ * .setCustomClass(CustomClass.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setCustomClassId("customClassId1871032322")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (CustomClass element : speechClient.listCustomClasses(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location of CustomClass resources to list. The expected
+ * format is `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCustomClassesPagedResponse listCustomClasses(LocationName parent) {
+ ListCustomClassesRequest request =
+ ListCustomClassesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listCustomClasses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomClasses.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (CustomClass element : speechClient.listCustomClasses(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location of CustomClass resources to list. The expected
+ * format is `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListCustomClassesPagedResponse listCustomClasses(String parent) {
+ ListCustomClassesRequest request =
+ ListCustomClassesRequest.newBuilder().setParent(parent).build();
+ return listCustomClasses(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomClasses.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * ListCustomClassesRequest request =
+ * ListCustomClassesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (CustomClass element : speechClient.listCustomClasses(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 ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request) {
+ return listCustomClassesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists CustomClasses.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * ListCustomClassesRequest request =
+ * ListCustomClassesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * ListCustomClassesRequest request =
+ * ListCustomClassesRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListCustomClassesResponse response = speechClient.listCustomClassesCallable().call(request);
+ * for (CustomClass element : response.getCustomClassesList()) {
+ * // 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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+ * CustomClass response = speechClient.getCustomClass(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomClass to retrieve. The expected format is
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomClass getCustomClass(CustomClassName name) {
+ GetCustomClassRequest request =
+ GetCustomClassRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getCustomClass(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [CustomClass][google.cloud.speech.v2.CustomClass].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+ * CustomClass response = speechClient.getCustomClass(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomClass to retrieve. The expected format is
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final CustomClass getCustomClass(String name) {
+ GetCustomClassRequest request = GetCustomClassRequest.newBuilder().setName(name).build();
+ return getCustomClass(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [CustomClass][google.cloud.speech.v2.CustomClass].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetCustomClassRequest request =
+ * GetCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .build();
+ * CustomClass response = speechClient.getCustomClass(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 CustomClass getCustomClass(GetCustomClassRequest request) {
+ return getCustomClassCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [CustomClass][google.cloud.speech.v2.CustomClass].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetCustomClassRequest request =
+ * GetCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CustomClass customClass = CustomClass.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * CustomClass response = speechClient.updateCustomClassAsync(customClass, updateMask).get();
+ * }
+ * }
+ *
+ * @param customClass Required. The CustomClass to update.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateCustomClassRequest request =
+ * UpdateCustomClassRequest.newBuilder()
+ * .setCustomClass(CustomClass.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .build();
+ * CustomClass response = speechClient.updateCustomClassAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateCustomClassRequest request =
+ * UpdateCustomClassRequest.newBuilder()
+ * .setCustomClass(CustomClass.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdateCustomClassRequest request =
+ * UpdateCustomClassRequest.newBuilder()
+ * .setCustomClass(CustomClass.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+ * CustomClass response = speechClient.deleteCustomClassAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomClass to delete. Format:
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+ * CustomClass response = speechClient.deleteCustomClassAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomClass to delete. Format:
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeleteCustomClassRequest request =
+ * DeleteCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * CustomClass response = speechClient.deleteCustomClassAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeleteCustomClassRequest request =
+ * DeleteCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeleteCustomClassRequest request =
+ * DeleteCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
+ * CustomClass response = speechClient.undeleteCustomClassAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomClass to undelete. Format:
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
+ * CustomClass response = speechClient.undeleteCustomClassAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the CustomClass to undelete. Format:
+ * `projects/{project}/locations/{location}/customClasses/{custom_class}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeleteCustomClassRequest request =
+ * UndeleteCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * CustomClass response = speechClient.undeleteCustomClassAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeleteCustomClassRequest request =
+ * UndeleteCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeleteCustomClassRequest request =
+ * UndeleteCustomClassRequest.newBuilder()
+ * .setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ * String phraseSetId = "phraseSetId959902180";
+ * PhraseSet response = speechClient.createPhraseSetAsync(parent, phraseSet, phraseSetId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project and location where this PhraseSet will be created. The
+ * expected format is `projects/{project}/locations/{location}`.
+ * @param phraseSet Required. The PhraseSet to create.
+ * @param phraseSetId The ID to use for the PhraseSet, which will become the final component of
+ * the PhraseSet's resource name.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ * String phraseSetId = "phraseSetId959902180";
+ * PhraseSet response = speechClient.createPhraseSetAsync(parent, phraseSet, phraseSetId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The project and location where this PhraseSet will be created. The
+ * expected format is `projects/{project}/locations/{location}`.
+ * @param phraseSet Required. The PhraseSet to create.
+ * @param phraseSetId The ID to use for the PhraseSet, which will become the final component of
+ * the PhraseSet's resource name.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * CreatePhraseSetRequest request =
+ * CreatePhraseSetRequest.newBuilder()
+ * .setPhraseSet(PhraseSet.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setPhraseSetId("phraseSetId959902180")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .build();
+ * PhraseSet response = speechClient.createPhraseSetAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CreatePhraseSetRequest request =
+ * CreatePhraseSetRequest.newBuilder()
+ * .setPhraseSet(PhraseSet.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setPhraseSetId("phraseSetId959902180")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * CreatePhraseSetRequest request =
+ * CreatePhraseSetRequest.newBuilder()
+ * .setPhraseSet(PhraseSet.newBuilder().build())
+ * .setValidateOnly(true)
+ * .setPhraseSetId("phraseSetId959902180")
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (PhraseSet element : speechClient.listPhraseSets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location of PhraseSet resources to list. The expected
+ * format is `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPhraseSetsPagedResponse listPhraseSets(LocationName parent) {
+ ListPhraseSetsRequest request =
+ ListPhraseSetsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listPhraseSets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PhraseSets.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (PhraseSet element : speechClient.listPhraseSets(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The project and location of PhraseSet resources to list. The expected
+ * format is `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPhraseSetsPagedResponse listPhraseSets(String parent) {
+ ListPhraseSetsRequest request = ListPhraseSetsRequest.newBuilder().setParent(parent).build();
+ return listPhraseSets(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PhraseSets.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * ListPhraseSetsRequest request =
+ * ListPhraseSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * for (PhraseSet element : speechClient.listPhraseSets(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 ListPhraseSetsPagedResponse listPhraseSets(ListPhraseSetsRequest request) {
+ return listPhraseSetsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists PhraseSets.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * ListPhraseSetsRequest request =
+ * ListPhraseSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * ListPhraseSetsRequest request =
+ * ListPhraseSetsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListPhraseSetsResponse response = speechClient.listPhraseSetsCallable().call(request);
+ * for (PhraseSet element : response.getPhraseSetsList()) {
+ * // 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 (SpeechClient speechClient = SpeechClient.create()) {
+ * PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+ * PhraseSet response = speechClient.getPhraseSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the PhraseSet to retrieve. The expected format is
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PhraseSet getPhraseSet(PhraseSetName name) {
+ GetPhraseSetRequest request =
+ GetPhraseSetRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getPhraseSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [PhraseSet][google.cloud.speech.v2.PhraseSet].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+ * PhraseSet response = speechClient.getPhraseSet(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the PhraseSet to retrieve. The expected format is
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PhraseSet getPhraseSet(String name) {
+ GetPhraseSetRequest request = GetPhraseSetRequest.newBuilder().setName(name).build();
+ return getPhraseSet(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [PhraseSet][google.cloud.speech.v2.PhraseSet].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetPhraseSetRequest request =
+ * GetPhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .build();
+ * PhraseSet response = speechClient.getPhraseSet(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 PhraseSet getPhraseSet(GetPhraseSetRequest request) {
+ return getPhraseSetCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns the requested [PhraseSet][google.cloud.speech.v2.PhraseSet].
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * GetPhraseSetRequest request =
+ * GetPhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * PhraseSet phraseSet = PhraseSet.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * PhraseSet response = speechClient.updatePhraseSetAsync(phraseSet, updateMask).get();
+ * }
+ * }
+ *
+ * @param phraseSet Required. The PhraseSet to update.
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdatePhraseSetRequest request =
+ * UpdatePhraseSetRequest.newBuilder()
+ * .setPhraseSet(PhraseSet.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .build();
+ * PhraseSet response = speechClient.updatePhraseSetAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdatePhraseSetRequest request =
+ * UpdatePhraseSetRequest.newBuilder()
+ * .setPhraseSet(PhraseSet.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UpdatePhraseSetRequest request =
+ * UpdatePhraseSetRequest.newBuilder()
+ * .setPhraseSet(PhraseSet.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setValidateOnly(true)
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+ * PhraseSet response = speechClient.deletePhraseSetAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PhraseSet to delete. Format:
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+ * PhraseSet response = speechClient.deletePhraseSetAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PhraseSet to delete. Format:
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeletePhraseSetRequest request =
+ * DeletePhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * PhraseSet response = speechClient.deletePhraseSetAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeletePhraseSetRequest request =
+ * DeletePhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * DeletePhraseSetRequest request =
+ * DeletePhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .setValidateOnly(true)
+ * .setAllowMissing(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
+ * PhraseSet response = speechClient.undeletePhraseSetAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PhraseSet to undelete. Format:
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
+ * PhraseSet response = speechClient.undeletePhraseSetAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. The name of the PhraseSet to undelete. Format:
+ * `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
+ * @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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeletePhraseSetRequest request =
+ * UndeletePhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .build();
+ * PhraseSet response = speechClient.undeletePhraseSetAsync(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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeletePhraseSetRequest request =
+ * UndeletePhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .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 (SpeechClient speechClient = SpeechClient.create()) {
+ * UndeletePhraseSetRequest request =
+ * UndeletePhraseSetRequest.newBuilder()
+ * .setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
+ * .setValidateOnly(true)
+ * .setEtag("etag3123477")
+ * .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
+ * SpeechSettings.Builder speechSettingsBuilder = SpeechSettings.newBuilder();
+ * speechSettingsBuilder
+ * .getRecognizerSettings()
+ * .setRetrySettings(
+ * speechSettingsBuilder.getRecognizerSettings().getRetrySettings().toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * SpeechSettings speechSettings = speechSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class SpeechSettings extends ClientSettings{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (SpeechClient speechClient = SpeechClient.create()) {
+ * RecognizerName name = RecognizerName.of("[PROJECT]", "[LOCATION]", "[RECOGNIZER]");
+ * Recognizer response = speechClient.getRecognizer(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.speech.v2;
+
+import javax.annotation.Generated;
diff --git a/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/GrpcSpeechCallableFactory.java b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/GrpcSpeechCallableFactory.java
new file mode 100644
index 000000000000..16b2e8aa8760
--- /dev/null
+++ b/java-speech/google-cloud-speech/src/main/java/com/google/cloud/speech/v2/stub/GrpcSpeechCallableFactory.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2022 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.speech.v2.stub;
+
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the Speech service API.
+ *
+ *