- 4.42.0 (latest)
- 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
public class AdaptationClient implements BackgroundResource
Service Description: Service that implements Google Cloud Speech Adaptation API.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
PhraseSet phraseSet = PhraseSet.newBuilder().build();
String phraseSetId = "phraseSetId959902180";
PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
}
Note: close() needs to be called on the AdaptationClient 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:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 AdaptationSettings 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
AdaptationSettings adaptationSettings =
AdaptationSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
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
AdaptationSettings adaptationSettings =
AdaptationSettings.newBuilder().setEndpoint(myEndpoint).build();
AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
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
AdaptationSettings adaptationSettings =
AdaptationSettings.newBuilder()
.setTransportChannelProvider(
AdaptationSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final AdaptationClient create()
Constructs an instance of AdaptationClient with default settings.
Type | Description |
AdaptationClient |
Type | Description |
IOException |
create(AdaptationSettings settings)
public static final AdaptationClient create(AdaptationSettings settings)
Constructs an instance of AdaptationClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | AdaptationSettings |
Type | Description |
AdaptationClient |
Type | Description |
IOException |
create(AdaptationStub stub)
public static final AdaptationClient create(AdaptationStub stub)
Constructs an instance of AdaptationClient, using the given stub for making calls. This is for advanced usage - prefer using create(AdaptationSettings).
Name | Description |
stub | AdaptationStub |
Type | Description |
AdaptationClient |
Constructors
AdaptationClient(AdaptationSettings settings)
protected AdaptationClient(AdaptationSettings settings)
Constructs an instance of AdaptationClient, 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.
Name | Description |
settings | AdaptationSettings |
AdaptationClient(AdaptationStub stub)
protected AdaptationClient(AdaptationStub stub)
Name | Description |
stub | AdaptationStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
createCustomClass(CreateCustomClassRequest request)
public final CustomClass createCustomClass(CreateCustomClassRequest request)
Create a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CreateCustomClassRequest request =
CreateCustomClassRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCustomClassId("customClassId1871032322")
.setCustomClass(CustomClass.newBuilder().build())
.build();
CustomClass response = adaptationClient.createCustomClass(request);
}
Name | Description |
request | CreateCustomClassRequest The request object containing all of the parameters for the API call. |
Type | Description |
CustomClass |
createCustomClass(LocationName parent, CustomClass customClass, String customClassId)
public final CustomClass createCustomClass(LocationName parent, CustomClass customClass, String customClassId)
Create a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
CustomClass customClass = CustomClass.newBuilder().build();
String customClassId = "customClassId1871032322";
CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
}
Name | Description |
parent | LocationName Required. The parent resource where this custom class will be created. Format:
Speech-to-Text supports three locations: |
customClass | CustomClass Required. The custom class to create. |
customClassId | String Required. The ID to use for the custom class, which will become the final component of the custom class' resource name. This value should restrict to letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and be 4-63 characters. |
Type | Description |
CustomClass |
createCustomClass(String parent, CustomClass customClass, String customClassId)
public final CustomClass createCustomClass(String parent, CustomClass customClass, String customClassId)
Create a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
CustomClass customClass = CustomClass.newBuilder().build();
String customClassId = "customClassId1871032322";
CustomClass response = adaptationClient.createCustomClass(parent, customClass, customClassId);
}
Name | Description |
parent | String Required. The parent resource where this custom class will be created. Format:
Speech-to-Text supports three locations: |
customClass | CustomClass Required. The custom class to create. |
customClassId | String Required. The ID to use for the custom class, which will become the final component of the custom class' resource name. This value should restrict to letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and be 4-63 characters. |
Type | Description |
CustomClass |
createCustomClassCallable()
public final UnaryCallable<CreateCustomClassRequest,CustomClass> createCustomClassCallable()
Create a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CreateCustomClassRequest request =
CreateCustomClassRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setCustomClassId("customClassId1871032322")
.setCustomClass(CustomClass.newBuilder().build())
.build();
ApiFuture<CustomClass> future =
adaptationClient.createCustomClassCallable().futureCall(request);
// Do something.
CustomClass response = future.get();
}
Type | Description |
UnaryCallable<CreateCustomClassRequest,CustomClass> |
createPhraseSet(CreatePhraseSetRequest request)
public final PhraseSet createPhraseSet(CreatePhraseSetRequest request)
Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes 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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CreatePhraseSetRequest request =
CreatePhraseSetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPhraseSetId("phraseSetId959902180")
.setPhraseSet(PhraseSet.newBuilder().build())
.build();
PhraseSet response = adaptationClient.createPhraseSet(request);
}
Name | Description |
request | CreatePhraseSetRequest The request object containing all of the parameters for the API call. |
Type | Description |
PhraseSet |
createPhraseSet(LocationName parent, PhraseSet phraseSet, String phraseSetId)
public final PhraseSet createPhraseSet(LocationName parent, PhraseSet phraseSet, String phraseSetId)
Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes 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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
PhraseSet phraseSet = PhraseSet.newBuilder().build();
String phraseSetId = "phraseSetId959902180";
PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
}
Name | Description |
parent | LocationName Required. The parent resource where this phrase set will be created. Format:
Speech-to-Text supports three locations: |
phraseSet | PhraseSet Required. The phrase set to create. |
phraseSetId | String Required. The ID to use for the phrase set, which will become the final component of the phrase set's resource name. This value should restrict to letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and be 4-63 characters. |
Type | Description |
PhraseSet |
createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId)
public final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId)
Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes 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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
PhraseSet phraseSet = PhraseSet.newBuilder().build();
String phraseSetId = "phraseSetId959902180";
PhraseSet response = adaptationClient.createPhraseSet(parent, phraseSet, phraseSetId);
}
Name | Description |
parent | String Required. The parent resource where this phrase set will be created. Format:
Speech-to-Text supports three locations: |
phraseSet | PhraseSet Required. The phrase set to create. |
phraseSetId | String Required. The ID to use for the phrase set, which will become the final component of the phrase set's resource name. This value should restrict to letters, numbers, and hyphens, with the first character a letter, the last a letter or a number, and be 4-63 characters. |
Type | Description |
PhraseSet |
createPhraseSetCallable()
public final UnaryCallable<CreatePhraseSetRequest,PhraseSet> createPhraseSetCallable()
Create a set of phrase hints. Each item in the set can be a single word or a multi-word phrase. The items in the PhraseSet are favored by the recognition model when you send a call that includes 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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CreatePhraseSetRequest request =
CreatePhraseSetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPhraseSetId("phraseSetId959902180")
.setPhraseSet(PhraseSet.newBuilder().build())
.build();
ApiFuture<PhraseSet> future = adaptationClient.createPhraseSetCallable().futureCall(request);
// Do something.
PhraseSet response = future.get();
}
Type | Description |
UnaryCallable<CreatePhraseSetRequest,PhraseSet> |
deleteCustomClass(CustomClassName name)
public final void deleteCustomClass(CustomClassName name)
Delete a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
adaptationClient.deleteCustomClass(name);
}
Name | Description |
name | CustomClassName Required. The name of the custom class to delete. Format:
Speech-to-Text supports three locations: |
deleteCustomClass(DeleteCustomClassRequest request)
public final void deleteCustomClass(DeleteCustomClassRequest request)
Delete a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
DeleteCustomClassRequest request =
DeleteCustomClassRequest.newBuilder()
.setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
.build();
adaptationClient.deleteCustomClass(request);
}
Name | Description |
request | DeleteCustomClassRequest The request object containing all of the parameters for the API call. |
deleteCustomClass(String name)
public final void deleteCustomClass(String name)
Delete a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
adaptationClient.deleteCustomClass(name);
}
Name | Description |
name | String Required. The name of the custom class to delete. Format:
Speech-to-Text supports three locations: |
deleteCustomClassCallable()
public final UnaryCallable<DeleteCustomClassRequest,Empty> deleteCustomClassCallable()
Delete a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
DeleteCustomClassRequest request =
DeleteCustomClassRequest.newBuilder()
.setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
.build();
ApiFuture<Empty> future = adaptationClient.deleteCustomClassCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteCustomClassRequest,Empty> |
deletePhraseSet(DeletePhraseSetRequest request)
public final void deletePhraseSet(DeletePhraseSetRequest request)
Delete a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
DeletePhraseSetRequest request =
DeletePhraseSetRequest.newBuilder()
.setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
.build();
adaptationClient.deletePhraseSet(request);
}
Name | Description |
request | DeletePhraseSetRequest The request object containing all of the parameters for the API call. |
deletePhraseSet(PhraseSetName name)
public final void deletePhraseSet(PhraseSetName name)
Delete a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
adaptationClient.deletePhraseSet(name);
}
Name | Description |
name | PhraseSetName Required. The name of the phrase set to delete. Format:
|
deletePhraseSet(String name)
public final void deletePhraseSet(String name)
Delete a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
adaptationClient.deletePhraseSet(name);
}
Name | Description |
name | String Required. The name of the phrase set to delete. Format:
|
deletePhraseSetCallable()
public final UnaryCallable<DeletePhraseSetRequest,Empty> deletePhraseSetCallable()
Delete a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
DeletePhraseSetRequest request =
DeletePhraseSetRequest.newBuilder()
.setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
.build();
ApiFuture<Empty> future = adaptationClient.deletePhraseSetCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeletePhraseSetRequest,Empty> |
getCustomClass(CustomClassName name)
public final CustomClass getCustomClass(CustomClassName name)
Get a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CustomClassName name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]");
CustomClass response = adaptationClient.getCustomClass(name);
}
Name | Description |
name | CustomClassName Required. The name of the custom class to retrieve. Format:
|
Type | Description |
CustomClass |
getCustomClass(GetCustomClassRequest request)
public final CustomClass getCustomClass(GetCustomClassRequest request)
Get a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
GetCustomClassRequest request =
GetCustomClassRequest.newBuilder()
.setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
.build();
CustomClass response = adaptationClient.getCustomClass(request);
}
Name | Description |
request | GetCustomClassRequest The request object containing all of the parameters for the API call. |
Type | Description |
CustomClass |
getCustomClass(String name)
public final CustomClass getCustomClass(String name)
Get a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String name = CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString();
CustomClass response = adaptationClient.getCustomClass(name);
}
Name | Description |
name | String Required. The name of the custom class to retrieve. Format:
|
Type | Description |
CustomClass |
getCustomClassCallable()
public final UnaryCallable<GetCustomClassRequest,CustomClass> getCustomClassCallable()
Get a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
GetCustomClassRequest request =
GetCustomClassRequest.newBuilder()
.setName(CustomClassName.of("[PROJECT]", "[LOCATION]", "[CUSTOM_CLASS]").toString())
.build();
ApiFuture<CustomClass> future = adaptationClient.getCustomClassCallable().futureCall(request);
// Do something.
CustomClass response = future.get();
}
Type | Description |
UnaryCallable<GetCustomClassRequest,CustomClass> |
getPhraseSet(GetPhraseSetRequest request)
public final PhraseSet getPhraseSet(GetPhraseSetRequest request)
Get a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
GetPhraseSetRequest request =
GetPhraseSetRequest.newBuilder()
.setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
.build();
PhraseSet response = adaptationClient.getPhraseSet(request);
}
Name | Description |
request | GetPhraseSetRequest The request object containing all of the parameters for the API call. |
Type | Description |
PhraseSet |
getPhraseSet(PhraseSetName name)
public final PhraseSet getPhraseSet(PhraseSetName name)
Get a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
PhraseSetName name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]");
PhraseSet response = adaptationClient.getPhraseSet(name);
}
Name | Description |
name | PhraseSetName Required. The name of the phrase set to retrieve. Format:
Speech-to-Text supports three locations: |
Type | Description |
PhraseSet |
getPhraseSet(String name)
public final PhraseSet getPhraseSet(String name)
Get a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String name = PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString();
PhraseSet response = adaptationClient.getPhraseSet(name);
}
Name | Description |
name | String Required. The name of the phrase set to retrieve. Format:
Speech-to-Text supports three locations: |
Type | Description |
PhraseSet |
getPhraseSetCallable()
public final UnaryCallable<GetPhraseSetRequest,PhraseSet> getPhraseSetCallable()
Get a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
GetPhraseSetRequest request =
GetPhraseSetRequest.newBuilder()
.setName(PhraseSetName.of("[PROJECT]", "[LOCATION]", "[PHRASE_SET]").toString())
.build();
ApiFuture<PhraseSet> future = adaptationClient.getPhraseSetCallable().futureCall(request);
// Do something.
PhraseSet response = future.get();
}
Type | Description |
UnaryCallable<GetPhraseSetRequest,PhraseSet> |
getSettings()
public final AdaptationSettings getSettings()
Type | Description |
AdaptationSettings |
getStub()
public AdaptationStub getStub()
Type | Description |
AdaptationStub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listCustomClasses(ListCustomClassesRequest request)
public final AdaptationClient.ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request)
List custom classes.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
ListCustomClassesRequest request =
ListCustomClassesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (CustomClass element : adaptationClient.listCustomClasses(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListCustomClassesRequest The request object containing all of the parameters for the API call. |
Type | Description |
AdaptationClient.ListCustomClassesPagedResponse |
listCustomClasses(LocationName parent)
public final AdaptationClient.ListCustomClassesPagedResponse listCustomClasses(LocationName parent)
List custom classes.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | LocationName Required. The parent, which owns this collection of custom classes. Format:
Speech-to-Text supports three locations: |
Type | Description |
AdaptationClient.ListCustomClassesPagedResponse |
listCustomClasses(String parent)
public final AdaptationClient.ListCustomClassesPagedResponse listCustomClasses(String parent)
List custom classes.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (CustomClass element : adaptationClient.listCustomClasses(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The parent, which owns this collection of custom classes. Format:
Speech-to-Text supports three locations: |
Type | Description |
AdaptationClient.ListCustomClassesPagedResponse |
listCustomClassesCallable()
public final UnaryCallable<ListCustomClassesRequest,ListCustomClassesResponse> listCustomClassesCallable()
List custom classes.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
ListCustomClassesRequest request =
ListCustomClassesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListCustomClassesResponse response =
adaptationClient.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;
}
}
}
Type | Description |
UnaryCallable<ListCustomClassesRequest,ListCustomClassesResponse> |
listCustomClassesPagedCallable()
public final UnaryCallable<ListCustomClassesRequest,AdaptationClient.ListCustomClassesPagedResponse> listCustomClassesPagedCallable()
List custom classes.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
ListCustomClassesRequest request =
ListCustomClassesRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<CustomClass> future =
adaptationClient.listCustomClassesPagedCallable().futureCall(request);
// Do something.
for (CustomClass element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListCustomClassesRequest,ListCustomClassesPagedResponse> |
listPhraseSet(ListPhraseSetRequest request)
public final AdaptationClient.ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request)
List phrase sets.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
ListPhraseSetRequest request =
ListPhraseSetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (PhraseSet element : adaptationClient.listPhraseSet(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request | ListPhraseSetRequest The request object containing all of the parameters for the API call. |
Type | Description |
AdaptationClient.ListPhraseSetPagedResponse |
listPhraseSet(LocationName parent)
public final AdaptationClient.ListPhraseSetPagedResponse listPhraseSet(LocationName parent)
List phrase sets.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | LocationName Required. The parent, which owns this collection of phrase set. Format:
Speech-to-Text supports three locations: |
Type | Description |
AdaptationClient.ListPhraseSetPagedResponse |
listPhraseSet(String parent)
public final AdaptationClient.ListPhraseSetPagedResponse listPhraseSet(String parent)
List phrase sets.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (PhraseSet element : adaptationClient.listPhraseSet(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The parent, which owns this collection of phrase set. Format:
Speech-to-Text supports three locations: |
Type | Description |
AdaptationClient.ListPhraseSetPagedResponse |
listPhraseSetCallable()
public final UnaryCallable<ListPhraseSetRequest,ListPhraseSetResponse> listPhraseSetCallable()
List phrase sets.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
ListPhraseSetRequest request =
ListPhraseSetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListPhraseSetResponse response = adaptationClient.listPhraseSetCallable().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;
}
}
}
Type | Description |
UnaryCallable<ListPhraseSetRequest,ListPhraseSetResponse> |
listPhraseSetPagedCallable()
public final UnaryCallable<ListPhraseSetRequest,AdaptationClient.ListPhraseSetPagedResponse> listPhraseSetPagedCallable()
List phrase sets.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
ListPhraseSetRequest request =
ListPhraseSetRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<PhraseSet> future =
adaptationClient.listPhraseSetPagedCallable().futureCall(request);
// Do something.
for (PhraseSet element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListPhraseSetRequest,ListPhraseSetPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateCustomClass(CustomClass customClass, FieldMask updateMask)
public final CustomClass updateCustomClass(CustomClass customClass, FieldMask updateMask)
Update a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
CustomClass customClass = CustomClass.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
CustomClass response = adaptationClient.updateCustomClass(customClass, updateMask);
}
Name | Description |
customClass | CustomClass Required. The custom class to update. The custom class's
Speech-to-Text supports three locations: |
updateMask | FieldMask The list of fields to be updated. |
Type | Description |
CustomClass |
updateCustomClass(UpdateCustomClassRequest request)
public final CustomClass updateCustomClass(UpdateCustomClassRequest request)
Update a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
UpdateCustomClassRequest request =
UpdateCustomClassRequest.newBuilder()
.setCustomClass(CustomClass.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
CustomClass response = adaptationClient.updateCustomClass(request);
}
Name | Description |
request | UpdateCustomClassRequest The request object containing all of the parameters for the API call. |
Type | Description |
CustomClass |
updateCustomClassCallable()
public final UnaryCallable<UpdateCustomClassRequest,CustomClass> updateCustomClassCallable()
Update a custom class.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
UpdateCustomClassRequest request =
UpdateCustomClassRequest.newBuilder()
.setCustomClass(CustomClass.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<CustomClass> future =
adaptationClient.updateCustomClassCallable().futureCall(request);
// Do something.
CustomClass response = future.get();
}
Type | Description |
UnaryCallable<UpdateCustomClassRequest,CustomClass> |
updatePhraseSet(PhraseSet phraseSet, FieldMask updateMask)
public final PhraseSet updatePhraseSet(PhraseSet phraseSet, FieldMask updateMask)
Update a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
PhraseSet phraseSet = PhraseSet.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
PhraseSet response = adaptationClient.updatePhraseSet(phraseSet, updateMask);
}
Name | Description |
phraseSet | PhraseSet Required. The phrase set to update. The phrase set's
Speech-to-Text supports three locations: |
updateMask | FieldMask The list of fields to be updated. |
Type | Description |
PhraseSet |
updatePhraseSet(UpdatePhraseSetRequest request)
public final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request)
Update a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
UpdatePhraseSetRequest request =
UpdatePhraseSetRequest.newBuilder()
.setPhraseSet(PhraseSet.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
PhraseSet response = adaptationClient.updatePhraseSet(request);
}
Name | Description |
request | UpdatePhraseSetRequest The request object containing all of the parameters for the API call. |
Type | Description |
PhraseSet |
updatePhraseSetCallable()
public final UnaryCallable<UpdatePhraseSetRequest,PhraseSet> updatePhraseSetCallable()
Update a phrase set.
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 (AdaptationClient adaptationClient = AdaptationClient.create()) {
UpdatePhraseSetRequest request =
UpdatePhraseSetRequest.newBuilder()
.setPhraseSet(PhraseSet.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<PhraseSet> future = adaptationClient.updatePhraseSetCallable().futureCall(request);
// Do something.
PhraseSet response = future.get();
}
Type | Description |
UnaryCallable<UpdatePhraseSetRequest,PhraseSet> |