- 4.46.0 (latest)
- 4.44.0
- 4.43.0
- 4.42.0
- 4.41.0
- 4.40.0
- 4.39.0
- 4.38.0
- 4.37.0
- 4.36.0
- 4.35.0
- 4.34.0
- 4.32.0
- 4.31.0
- 4.30.0
- 4.29.0
- 4.28.0
- 4.27.0
- 4.26.0
- 4.25.0
- 4.24.0
- 4.23.0
- 4.22.0
- 4.19.0
- 4.18.0
- 4.17.0
- 4.16.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.0
- 4.8.0
- 4.7.0
- 4.6.0
- 4.4.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.0
- 3.0.0
- 2.6.1
- 2.5.9
- 2.4.0
- 2.3.0
- 2.2.15
GitHub Repository | Product Reference | REST Documentation | RPC Documentation |
Service Description: Enables speech transcription and resource management.
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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().
Method | Description | Method Variants |
---|---|---|
CreateRecognizer | Creates a Recognizer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRecognizers | Lists Recognizers. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRecognizer | Returns the requested Recognizer. Fails with NOT_FOUND if the requested Recognizer doesn't exist. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateRecognizer | Updates the Recognizer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteRecognizer | Deletes the Recognizer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UndeleteRecognizer | Undeletes the Recognizer. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
Recognize | Performs synchronous Speech recognition: receive results after all audio has been sent and processed. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StreamingRecognize | Performs bidirectional streaming speech recognition: receive results while sending audio. This method is only available via the gRPC API (not REST). |
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
BatchRecognize | Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetConfig | Returns the requested Config. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateConfig | Updates the Config. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateCustomClass | Creates a CustomClass. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListCustomClasses | Lists CustomClasses. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetCustomClass | Returns the requested CustomClass. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateCustomClass | Updates the CustomClass. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteCustomClass | Deletes the CustomClass. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UndeleteCustomClass | Undeletes the CustomClass. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreatePhraseSet | Creates a PhraseSet. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListPhraseSets | Lists PhraseSets. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetPhraseSet | Returns the requested PhraseSet. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdatePhraseSet | Updates the PhraseSet. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeletePhraseSet | Deletes the PhraseSet. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UndeletePhraseSet | Undeletes the PhraseSet. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations | Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation | Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require 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.newHttpJsonBuilder().build();
SpeechClient speechClient = SpeechClient.create(speechSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final SpeechClient create()
Constructs an instance of SpeechClient with default settings.
Returns | |
---|---|
Type | Description |
SpeechClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(SpeechSettings settings)
public static final SpeechClient create(SpeechSettings settings)
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.
Parameter | |
---|---|
Name | Description |
settings | SpeechSettings |
Returns | |
---|---|
Type | Description |
SpeechClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(SpeechStub stub)
public static final SpeechClient create(SpeechStub stub)
Constructs an instance of SpeechClient, using the given stub for making calls. This is for advanced usage - prefer using create(SpeechSettings).
Parameter | |
---|---|
Name | Description |
stub | SpeechStub |
Returns | |
---|---|
Type | Description |
SpeechClient |
Constructors
SpeechClient(SpeechSettings settings)
protected SpeechClient(SpeechSettings settings)
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.
Parameter | |
---|---|
Name | Description |
settings | SpeechSettings |
SpeechClient(SpeechStub stub)
protected SpeechClient(SpeechStub stub)
Parameter | |
---|---|
Name | Description |
stub | SpeechStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration | long |
unit | TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
batchRecognizeAsync(BatchRecognizeRequest request)
public final OperationFuture<BatchRecognizeResponse,OperationMetadata> batchRecognizeAsync(BatchRecognizeRequest request)
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<BatchRecognizeFileMetadata>())
.setRecognitionOutputConfig(RecognitionOutputConfig.newBuilder().build())
.build();
BatchRecognizeResponse response = speechClient.batchRecognizeAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request | BatchRecognizeRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<BatchRecognizeResponse,OperationMetadata> |
batchRecognizeAsync(RecognizerName recognizer, RecognitionConfig config, FieldMask configMask, List<BatchRecognizeFileMetadata> files)
public final OperationFuture<BatchRecognizeResponse,OperationMetadata> batchRecognizeAsync(RecognizerName recognizer, RecognitionConfig config, FieldMask configMask, List<BatchRecognizeFileMetadata> files)
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<BatchRecognizeFileMetadata> files = new ArrayList<>();
BatchRecognizeResponse response =
speechClient.batchRecognizeAsync(recognizer, config, configMask, files).get();
}
Parameters | |
---|---|
Name | Description |
recognizer | RecognizerName Required. The name of the Recognizer to use during recognition. The expected
format is |
config | RecognitionConfig Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the config_mask field can be used to override parts of the default_recognition_config of the Recognizer resource. |
configMask | FieldMask The list of fields in
config that override the values in
the
default_recognition_config
of the recognizer during this recognition request. If no mask is provided, all given fields
in 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
( |
files | List<BatchRecognizeFileMetadata> Audio files with file metadata for ASR. The maximum number of files allowed to be specified is 5. |
Returns | |
---|---|
Type | Description |
OperationFuture<BatchRecognizeResponse,OperationMetadata> |
batchRecognizeAsync(String recognizer, RecognitionConfig config, FieldMask configMask, List<BatchRecognizeFileMetadata> files)
public final OperationFuture<BatchRecognizeResponse,OperationMetadata> batchRecognizeAsync(String recognizer, RecognitionConfig config, FieldMask configMask, List<BatchRecognizeFileMetadata> files)
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<BatchRecognizeFileMetadata> files = new ArrayList<>();
BatchRecognizeResponse response =
speechClient.batchRecognizeAsync(recognizer, config, configMask, files).get();
}
Parameters | |
---|---|
Name | Description |
recognizer | String Required. The name of the Recognizer to use during recognition. The expected
format is |
config | RecognitionConfig Features and audio metadata to use for the Automatic Speech Recognition. This field in combination with the config_mask field can be used to override parts of the default_recognition_config of the Recognizer resource. |
configMask | FieldMask The list of fields in
config that override the values in
the
default_recognition_config
of the recognizer during this recognition request. If no mask is provided, all given fields
in 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
( |
files | List<BatchRecognizeFileMetadata> Audio files with file metadata for ASR. The maximum number of files allowed to be specified is 5. |
Returns | |
---|---|
Type | Description |
OperationFuture<BatchRecognizeResponse,OperationMetadata> |
batchRecognizeCallable()
public final UnaryCallable<BatchRecognizeRequest,Operation> batchRecognizeCallable()
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<BatchRecognizeFileMetadata>())
.setRecognitionOutputConfig(RecognitionOutputConfig.newBuilder().build())
.build();
ApiFuture<Operation> future = speechClient.batchRecognizeCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<BatchRecognizeRequest,Operation> |
batchRecognizeOperationCallable()
public final OperationCallable<BatchRecognizeRequest,BatchRecognizeResponse,OperationMetadata> batchRecognizeOperationCallable()
Performs batch asynchronous speech recognition: send a request with N audio files and receive a long running operation that can be polled to see when the transcriptions are finished.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<BatchRecognizeFileMetadata>())
.setRecognitionOutputConfig(RecognitionOutputConfig.newBuilder().build())
.build();
OperationFuture<BatchRecognizeResponse, OperationMetadata> future =
speechClient.batchRecognizeOperationCallable().futureCall(request);
// Do something.
BatchRecognizeResponse response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<BatchRecognizeRequest,BatchRecognizeResponse,OperationMetadata> |
close()
public final void close()
createCustomClassAsync(CreateCustomClassRequest request)
public final OperationFuture<CustomClass,OperationMetadata> createCustomClassAsync(CreateCustomClassRequest request)
Creates a CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | CreateCustomClassRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<CustomClass,OperationMetadata> |
createCustomClassAsync(LocationName parent, CustomClass customClass, String customClassId)
public final OperationFuture<CustomClass,OperationMetadata> createCustomClassAsync(LocationName parent, CustomClass customClass, String customClassId)
Creates a CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project and location where this CustomClass will be created. The
expected format is |
customClass | CustomClass Required. The CustomClass to create. |
customClassId | String The ID to use for the CustomClass, which will become the final component of the CustomClass's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. |
Returns | |
---|---|
Type | Description |
OperationFuture<CustomClass,OperationMetadata> |
createCustomClassAsync(String parent, CustomClass customClass, String customClassId)
public final OperationFuture<CustomClass,OperationMetadata> createCustomClassAsync(String parent, CustomClass customClass, String customClassId)
Creates a CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The project and location where this CustomClass will be created. The
expected format is |
customClass | CustomClass Required. The CustomClass to create. |
customClassId | String The ID to use for the CustomClass, which will become the final component of the CustomClass's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. |
Returns | |
---|---|
Type | Description |
OperationFuture<CustomClass,OperationMetadata> |
createCustomClassCallable()
public final UnaryCallable<CreateCustomClassRequest,Operation> createCustomClassCallable()
Creates a CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Operation> future = speechClient.createCustomClassCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateCustomClassRequest,Operation> |
createCustomClassOperationCallable()
public final OperationCallable<CreateCustomClassRequest,CustomClass,OperationMetadata> createCustomClassOperationCallable()
Creates a CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<CustomClass, OperationMetadata> future =
speechClient.createCustomClassOperationCallable().futureCall(request);
// Do something.
CustomClass response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateCustomClassRequest,CustomClass,OperationMetadata> |
createPhraseSetAsync(CreatePhraseSetRequest request)
public final OperationFuture<PhraseSet,OperationMetadata> createPhraseSetAsync(CreatePhraseSetRequest request)
Creates a PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | CreatePhraseSetRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<PhraseSet,OperationMetadata> |
createPhraseSetAsync(LocationName parent, PhraseSet phraseSet, String phraseSetId)
public final OperationFuture<PhraseSet,OperationMetadata> createPhraseSetAsync(LocationName parent, PhraseSet phraseSet, String phraseSetId)
Creates a PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project and location where this PhraseSet will be created. The
expected format is |
phraseSet | PhraseSet Required. The PhraseSet to create. |
phraseSetId | String The ID to use for the PhraseSet, which will become the final component of the PhraseSet's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. |
Returns | |
---|---|
Type | Description |
OperationFuture<PhraseSet,OperationMetadata> |
createPhraseSetAsync(String parent, PhraseSet phraseSet, String phraseSetId)
public final OperationFuture<PhraseSet,OperationMetadata> createPhraseSetAsync(String parent, PhraseSet phraseSet, String phraseSetId)
Creates a PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The project and location where this PhraseSet will be created. The
expected format is |
phraseSet | PhraseSet Required. The PhraseSet to create. |
phraseSetId | String The ID to use for the PhraseSet, which will become the final component of the PhraseSet's resource name. This value should be 4-63 characters, and valid characters are /a-z-/. |
Returns | |
---|---|
Type | Description |
OperationFuture<PhraseSet,OperationMetadata> |
createPhraseSetCallable()
public final UnaryCallable<CreatePhraseSetRequest,Operation> createPhraseSetCallable()
Creates a PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Operation> future = speechClient.createPhraseSetCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreatePhraseSetRequest,Operation> |
createPhraseSetOperationCallable()
public final OperationCallable<CreatePhraseSetRequest,PhraseSet,OperationMetadata> createPhraseSetOperationCallable()
Creates a PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<PhraseSet, OperationMetadata> future =
speechClient.createPhraseSetOperationCallable().futureCall(request);
// Do something.
PhraseSet response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreatePhraseSetRequest,PhraseSet,OperationMetadata> |
createRecognizerAsync(CreateRecognizerRequest request)
public final OperationFuture<Recognizer,OperationMetadata> createRecognizerAsync(CreateRecognizerRequest request)
Creates a Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | CreateRecognizerRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Recognizer,OperationMetadata> |
createRecognizerAsync(LocationName parent, Recognizer recognizer, String recognizerId)
public final OperationFuture<Recognizer,OperationMetadata> createRecognizerAsync(LocationName parent, Recognizer recognizer, String recognizerId)
Creates a Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project and location where this Recognizer will be created. The
expected format is |
recognizer | Recognizer Required. The Recognizer to create. |
recognizerId | String 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-/. |
Returns | |
---|---|
Type | Description |
OperationFuture<Recognizer,OperationMetadata> |
createRecognizerAsync(String parent, Recognizer recognizer, String recognizerId)
public final OperationFuture<Recognizer,OperationMetadata> createRecognizerAsync(String parent, Recognizer recognizer, String recognizerId)
Creates a Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameters | |
---|---|
Name | Description |
parent | String Required. The project and location where this Recognizer will be created. The
expected format is |
recognizer | Recognizer Required. The Recognizer to create. |
recognizerId | String 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-/. |
Returns | |
---|---|
Type | Description |
OperationFuture<Recognizer,OperationMetadata> |
createRecognizerCallable()
public final UnaryCallable<CreateRecognizerRequest,Operation> createRecognizerCallable()
Creates a Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Operation> future = speechClient.createRecognizerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateRecognizerRequest,Operation> |
createRecognizerOperationCallable()
public final OperationCallable<CreateRecognizerRequest,Recognizer,OperationMetadata> createRecognizerOperationCallable()
Creates a Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Recognizer, OperationMetadata> future =
speechClient.createRecognizerOperationCallable().futureCall(request);
// Do something.
Recognizer response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateRecognizerRequest,Recognizer,OperationMetadata> |
deleteCustomClassAsync(CustomClassName name)
public final OperationFuture<CustomClass,OperationMetadata> deleteCustomClassAsync(CustomClassName name)
Deletes the CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
name | CustomClassName Required. The name of the CustomClass to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<CustomClass,OperationMetadata> |
deleteCustomClassAsync(DeleteCustomClassRequest request)
public final OperationFuture<CustomClass,OperationMetadata> deleteCustomClassAsync(DeleteCustomClassRequest request)
Deletes the CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | DeleteCustomClassRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<CustomClass,OperationMetadata> |
deleteCustomClassAsync(String name)
public final OperationFuture<CustomClass,OperationMetadata> deleteCustomClassAsync(String name)
Deletes the CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the CustomClass to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<CustomClass,OperationMetadata> |
deleteCustomClassCallable()
public final UnaryCallable<DeleteCustomClassRequest,Operation> deleteCustomClassCallable()
Deletes the CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Operation> future = speechClient.deleteCustomClassCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteCustomClassRequest,Operation> |
deleteCustomClassOperationCallable()
public final OperationCallable<DeleteCustomClassRequest,CustomClass,OperationMetadata> deleteCustomClassOperationCallable()
Deletes the CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<CustomClass, OperationMetadata> future =
speechClient.deleteCustomClassOperationCallable().futureCall(request);
// Do something.
CustomClass response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteCustomClassRequest,CustomClass,OperationMetadata> |
deletePhraseSetAsync(DeletePhraseSetRequest request)
public final OperationFuture<PhraseSet,OperationMetadata> deletePhraseSetAsync(DeletePhraseSetRequest request)
Deletes the PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | DeletePhraseSetRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<PhraseSet,OperationMetadata> |
deletePhraseSetAsync(PhraseSetName name)
public final OperationFuture<PhraseSet,OperationMetadata> deletePhraseSetAsync(PhraseSetName name)
Deletes the PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
name | PhraseSetName Required. The name of the PhraseSet to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<PhraseSet,OperationMetadata> |
deletePhraseSetAsync(String name)
public final OperationFuture<PhraseSet,OperationMetadata> deletePhraseSetAsync(String name)
Deletes the PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the PhraseSet to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<PhraseSet,OperationMetadata> |
deletePhraseSetCallable()
public final UnaryCallable<DeletePhraseSetRequest,Operation> deletePhraseSetCallable()
Deletes the PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Operation> future = speechClient.deletePhraseSetCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeletePhraseSetRequest,Operation> |
deletePhraseSetOperationCallable()
public final OperationCallable<DeletePhraseSetRequest,PhraseSet,OperationMetadata> deletePhraseSetOperationCallable()
Deletes the PhraseSet.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<PhraseSet, OperationMetadata> future =
speechClient.deletePhraseSetOperationCallable().futureCall(request);
// Do something.
PhraseSet response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeletePhraseSetRequest,PhraseSet,OperationMetadata> |
deleteRecognizerAsync(DeleteRecognizerRequest request)
public final OperationFuture<Recognizer,OperationMetadata> deleteRecognizerAsync(DeleteRecognizerRequest request)
Deletes the Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
request | DeleteRecognizerRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Recognizer,OperationMetadata> |
deleteRecognizerAsync(RecognizerName name)
public final OperationFuture<Recognizer,OperationMetadata> deleteRecognizerAsync(RecognizerName name)
Deletes the Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
name | RecognizerName Required. The name of the Recognizer to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Recognizer,OperationMetadata> |
deleteRecognizerAsync(String name)
public final OperationFuture<Recognizer,OperationMetadata> deleteRecognizerAsync(String name)
Deletes the Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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();
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the Recognizer to delete. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Recognizer,OperationMetadata> |
deleteRecognizerCallable()
public final UnaryCallable<DeleteRecognizerRequest,Operation> deleteRecognizerCallable()
Deletes the Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Operation> future = speechClient.deleteRecognizerCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteRecognizerRequest,Operation> |
deleteRecognizerOperationCallable()
public final OperationCallable<DeleteRecognizerRequest,Recognizer,OperationMetadata> deleteRecognizerOperationCallable()
Deletes the Recognizer.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Recognizer, OperationMetadata> future =
speechClient.deleteRecognizerOperationCallable().futureCall(request);
// Do something.
Recognizer response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteRecognizerRequest,Recognizer,OperationMetadata> |
getConfig(ConfigName name)
public final Config getConfig(ConfigName name)
Returns the requested Config.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
name | ConfigName Required. The name of the config to retrieve. There is exactly one config resource
per project per location. The expected format is
|
Returns | |
---|---|
Type | Description |
Config |
getConfig(GetConfigRequest request)
public final Config getConfig(GetConfigRequest request)
Returns the requested Config.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
request | GetConfigRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Config |
getConfig(String name)
public final Config getConfig(String name)
Returns the requested Config.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
name | String Required. The name of the config to retrieve. There is exactly one config resource
per project per location. The expected format is
|
Returns | |
---|---|
Type | Description |
Config |
getConfigCallable()
public final UnaryCallable<GetConfigRequest,Config> getConfigCallable()
Returns the requested Config.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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<Config> future = speechClient.getConfigCallable().futureCall(request);
// Do something.
Config response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetConfigRequest,Config> |
getCustomClass(CustomClassName name)
public final CustomClass getCustomClass(CustomClassName name)
Returns the requested CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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);
}
Parameter | |
---|---|
Name | Description |
name | CustomClassName Required. The name of the CustomClass to retrieve. The expected format is
|
Returns | |
---|---|
Type | Description |
CustomClass |
getCustomClass(GetCustomClassRequest request)
public final CustomClass getCustomClass(GetCustomClassRequest request)
Returns the requested CustomClass.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying 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]",<