@Generated(value="by gapic-generator-java") public class AdaptationClient extends Object implements com.google.api.gax.core.BackgroundResource
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().
| Method | Description | Method Variants |
|---|---|---|
| CreatePhraseSet | 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. |
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 | Get a phrase set. |
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.
|
| ListPhraseSet | List phrase sets. |
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 | Update a phrase set. |
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.
|
| DeletePhraseSet | Delete a phrase set. |
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 | Create a custom class. |
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 | Get a custom class. |
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.
|
| ListCustomClasses | List custom classes. |
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 | Update a custom class. |
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.
|
| DeleteCustomClass | Delete a custom class. |
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.
|
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.newHttpJsonBuilder().build();
AdaptationClient adaptationClient = AdaptationClient.create(adaptationSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
AdaptationClient.ListCustomClassesFixedSizeCollection |
static class |
AdaptationClient.ListCustomClassesPage |
static class |
AdaptationClient.ListCustomClassesPagedResponse |
static class |
AdaptationClient.ListPhraseSetFixedSizeCollection |
static class |
AdaptationClient.ListPhraseSetPage |
static class |
AdaptationClient.ListPhraseSetPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
AdaptationClient(AdaptationSettings settings)
Constructs an instance of AdaptationClient, using the given settings.
|
protected |
AdaptationClient(AdaptationStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static AdaptationClient |
create()
Constructs an instance of AdaptationClient with default settings.
|
static AdaptationClient |
create(AdaptationSettings settings)
Constructs an instance of AdaptationClient, using the given settings.
|
static AdaptationClient |
create(AdaptationStub stub)
Constructs an instance of AdaptationClient, using the given stub for making calls.
|
CustomClass |
createCustomClass(CreateCustomClassRequest request)
Create a custom class.
|
CustomClass |
createCustomClass(LocationName parent,
CustomClass customClass,
String customClassId)
Create a custom class.
|
CustomClass |
createCustomClass(String parent,
CustomClass customClass,
String customClassId)
Create a custom class.
|
com.google.api.gax.rpc.UnaryCallable<CreateCustomClassRequest,CustomClass> |
createCustomClassCallable()
Create a custom class.
|
PhraseSet |
createPhraseSet(CreatePhraseSetRequest request)
Create a set of phrase hints.
|
PhraseSet |
createPhraseSet(LocationName parent,
PhraseSet phraseSet,
String phraseSetId)
Create a set of phrase hints.
|
PhraseSet |
createPhraseSet(String parent,
PhraseSet phraseSet,
String phraseSetId)
Create a set of phrase hints.
|
com.google.api.gax.rpc.UnaryCallable<CreatePhraseSetRequest,PhraseSet> |
createPhraseSetCallable()
Create a set of phrase hints.
|
void |
deleteCustomClass(CustomClassName name)
Delete a custom class.
|
void |
deleteCustomClass(DeleteCustomClassRequest request)
Delete a custom class.
|
void |
deleteCustomClass(String name)
Delete a custom class.
|
com.google.api.gax.rpc.UnaryCallable<DeleteCustomClassRequest,com.google.protobuf.Empty> |
deleteCustomClassCallable()
Delete a custom class.
|
void |
deletePhraseSet(DeletePhraseSetRequest request)
Delete a phrase set.
|
void |
deletePhraseSet(PhraseSetName name)
Delete a phrase set.
|
void |
deletePhraseSet(String name)
Delete a phrase set.
|
com.google.api.gax.rpc.UnaryCallable<DeletePhraseSetRequest,com.google.protobuf.Empty> |
deletePhraseSetCallable()
Delete a phrase set.
|
CustomClass |
getCustomClass(CustomClassName name)
Get a custom class.
|
CustomClass |
getCustomClass(GetCustomClassRequest request)
Get a custom class.
|
CustomClass |
getCustomClass(String name)
Get a custom class.
|
com.google.api.gax.rpc.UnaryCallable<GetCustomClassRequest,CustomClass> |
getCustomClassCallable()
Get a custom class.
|
PhraseSet |
getPhraseSet(GetPhraseSetRequest request)
Get a phrase set.
|
PhraseSet |
getPhraseSet(PhraseSetName name)
Get a phrase set.
|
PhraseSet |
getPhraseSet(String name)
Get a phrase set.
|
com.google.api.gax.rpc.UnaryCallable<GetPhraseSetRequest,PhraseSet> |
getPhraseSetCallable()
Get a phrase set.
|
AdaptationSettings |
getSettings() |
AdaptationStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
AdaptationClient.ListCustomClassesPagedResponse |
listCustomClasses(ListCustomClassesRequest request)
List custom classes.
|
AdaptationClient.ListCustomClassesPagedResponse |
listCustomClasses(LocationName parent)
List custom classes.
|
AdaptationClient.ListCustomClassesPagedResponse |
listCustomClasses(String parent)
List custom classes.
|
com.google.api.gax.rpc.UnaryCallable<ListCustomClassesRequest,ListCustomClassesResponse> |
listCustomClassesCallable()
List custom classes.
|
com.google.api.gax.rpc.UnaryCallable<ListCustomClassesRequest,AdaptationClient.ListCustomClassesPagedResponse> |
listCustomClassesPagedCallable()
List custom classes.
|
AdaptationClient.ListPhraseSetPagedResponse |
listPhraseSet(ListPhraseSetRequest request)
List phrase sets.
|
AdaptationClient.ListPhraseSetPagedResponse |
listPhraseSet(LocationName parent)
List phrase sets.
|
AdaptationClient.ListPhraseSetPagedResponse |
listPhraseSet(String parent)
List phrase sets.
|
com.google.api.gax.rpc.UnaryCallable<ListPhraseSetRequest,ListPhraseSetResponse> |
listPhraseSetCallable()
List phrase sets.
|
com.google.api.gax.rpc.UnaryCallable<ListPhraseSetRequest,AdaptationClient.ListPhraseSetPagedResponse> |
listPhraseSetPagedCallable()
List phrase sets.
|
void |
shutdown() |
void |
shutdownNow() |
CustomClass |
updateCustomClass(CustomClass customClass,
com.google.protobuf.FieldMask updateMask)
Update a custom class.
|
CustomClass |
updateCustomClass(UpdateCustomClassRequest request)
Update a custom class.
|
com.google.api.gax.rpc.UnaryCallable<UpdateCustomClassRequest,CustomClass> |
updateCustomClassCallable()
Update a custom class.
|
PhraseSet |
updatePhraseSet(PhraseSet phraseSet,
com.google.protobuf.FieldMask updateMask)
Update a phrase set.
|
PhraseSet |
updatePhraseSet(UpdatePhraseSetRequest request)
Update a phrase set.
|
com.google.api.gax.rpc.UnaryCallable<UpdatePhraseSetRequest,PhraseSet> |
updatePhraseSetCallable()
Update a phrase set.
|
protected AdaptationClient(AdaptationSettings settings) throws IOException
IOExceptionprotected AdaptationClient(AdaptationStub stub)
public static final AdaptationClient create() throws IOException
IOExceptionpublic static final AdaptationClient create(AdaptationSettings settings) throws IOException
IOExceptionpublic static final AdaptationClient create(AdaptationStub stub)
public final AdaptationSettings getSettings()
public AdaptationStub getStub()
public final PhraseSet createPhraseSet(LocationName parent, PhraseSet phraseSet, String phraseSetId)
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);
}
parent - Required. The parent resource where this phrase set will be created. Format:
`projects/{project}/locations/{location}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
phraseSet - Required. The phrase set to create.phraseSetId - 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.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final PhraseSet createPhraseSet(String parent, PhraseSet phraseSet, String phraseSetId)
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);
}
parent - Required. The parent resource where this phrase set will be created. Format:
`projects/{project}/locations/{location}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
phraseSet - Required. The phrase set to create.phraseSetId - 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.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final PhraseSet createPhraseSet(CreatePhraseSetRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreatePhraseSetRequest,PhraseSet> createPhraseSetCallable()
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();
}
public final PhraseSet getPhraseSet(PhraseSetName name)
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 - Required. The name of the phrase set to retrieve. Format:
`projects/{project}/locations/{location}/phraseSets/{phrase_set}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final PhraseSet getPhraseSet(String name)
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 - Required. The name of the phrase set to retrieve. Format:
`projects/{project}/locations/{location}/phraseSets/{phrase_set}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final PhraseSet getPhraseSet(GetPhraseSetRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetPhraseSetRequest,PhraseSet> getPhraseSetCallable()
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();
}
public final AdaptationClient.ListPhraseSetPagedResponse listPhraseSet(LocationName parent)
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);
}
}
parent - Required. The parent, which owns this collection of phrase set. Format:
`projects/{project}/locations/{location}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AdaptationClient.ListPhraseSetPagedResponse listPhraseSet(String parent)
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);
}
}
parent - Required. The parent, which owns this collection of phrase set. Format:
`projects/{project}/locations/{location}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AdaptationClient.ListPhraseSetPagedResponse listPhraseSet(ListPhraseSetRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListPhraseSetRequest,AdaptationClient.ListPhraseSetPagedResponse> listPhraseSetPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListPhraseSetRequest,ListPhraseSetResponse> listPhraseSetCallable()
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;
}
}
}
public final PhraseSet updatePhraseSet(PhraseSet phraseSet, com.google.protobuf.FieldMask updateMask)
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);
}
phraseSet - Required. The phrase set to update.
The phrase set's `name` field is used to identify the set to be updated. Format:
`projects/{project}/locations/{location}/phraseSets/{phrase_set}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
updateMask - The list of fields to be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PhraseSet updatePhraseSet(UpdatePhraseSetRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdatePhraseSetRequest,PhraseSet> updatePhraseSetCallable()
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();
}
public final void deletePhraseSet(PhraseSetName name)
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 - Required. The name of the phrase set to delete. Format:
`projects/{project}/locations/{location}/phraseSets/{phrase_set}`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deletePhraseSet(String name)
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 - Required. The name of the phrase set to delete. Format:
`projects/{project}/locations/{location}/phraseSets/{phrase_set}`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deletePhraseSet(DeletePhraseSetRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeletePhraseSetRequest,com.google.protobuf.Empty> deletePhraseSetCallable()
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();
}
public final CustomClass createCustomClass(LocationName parent, CustomClass customClass, String customClassId)
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);
}
parent - Required. The parent resource where this custom class will be created. Format:
`projects/{project}/locations/{location}/customClasses`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
customClass - Required. The custom class to create.customClassId - 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.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomClass createCustomClass(String parent, CustomClass customClass, String customClassId)
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);
}
parent - Required. The parent resource where this custom class will be created. Format:
`projects/{project}/locations/{location}/customClasses`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
customClass - Required. The custom class to create.customClassId - 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.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomClass createCustomClass(CreateCustomClassRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateCustomClassRequest,CustomClass> createCustomClassCallable()
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();
}
public final CustomClass getCustomClass(CustomClassName name)
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 - Required. The name of the custom class to retrieve. Format:
`projects/{project}/locations/{location}/customClasses/{custom_class}`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomClass getCustomClass(String name)
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 - Required. The name of the custom class to retrieve. Format:
`projects/{project}/locations/{location}/customClasses/{custom_class}`
com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomClass getCustomClass(GetCustomClassRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetCustomClassRequest,CustomClass> getCustomClassCallable()
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();
}
public final AdaptationClient.ListCustomClassesPagedResponse listCustomClasses(LocationName parent)
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);
}
}
parent - Required. The parent, which owns this collection of custom classes. Format:
`projects/{project}/locations/{location}/customClasses`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AdaptationClient.ListCustomClassesPagedResponse listCustomClasses(String parent)
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);
}
}
parent - Required. The parent, which owns this collection of custom classes. Format:
`projects/{project}/locations/{location}/customClasses`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final AdaptationClient.ListCustomClassesPagedResponse listCustomClasses(ListCustomClassesRequest request)
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListCustomClassesRequest,AdaptationClient.ListCustomClassesPagedResponse> listCustomClassesPagedCallable()
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);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListCustomClassesRequest,ListCustomClassesResponse> listCustomClassesCallable()
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;
}
}
}
public final CustomClass updateCustomClass(CustomClass customClass, com.google.protobuf.FieldMask updateMask)
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);
}
customClass - Required. The custom class to update.
The custom class's `name` field is used to identify the custom class to be updated. Format:
`projects/{project}/locations/{location}/customClasses/{custom_class}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
updateMask - The list of fields to be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final CustomClass updateCustomClass(UpdateCustomClassRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateCustomClassRequest,CustomClass> updateCustomClassCallable()
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();
}
public final void deleteCustomClass(CustomClassName name)
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 - Required. The name of the custom class to delete. Format:
`projects/{project}/locations/{location}/customClasses/{custom_class}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteCustomClass(String name)
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 - Required. The name of the custom class to delete. Format:
`projects/{project}/locations/{location}/customClasses/{custom_class}`
Speech-to-Text supports three locations: `global`, `us` (US North America), and `eu` (Europe). If you are calling the `speech.googleapis.com` endpoint, use the `global` location. To specify a region, use a [regional endpoint](https://cloud.google.com/speech-to-text/docs/endpoints) with matching `us` or `eu` location value.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteCustomClass(DeleteCustomClassRequest request)
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);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteCustomClassRequest,com.google.protobuf.Empty> deleteCustomClassCallable()
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();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.