- 4.58.0 (latest)
- 4.57.0
- 4.55.0
- 4.54.0
- 4.53.0
- 4.52.0
- 4.51.0
- 4.50.0
- 4.49.0
- 4.48.0
- 4.47.0
- 4.46.0
- 4.45.0
- 4.43.0
- 4.42.0
- 4.41.0
- 4.40.0
- 4.39.0
- 4.38.0
- 4.37.0
- 4.36.0
- 4.35.0
- 4.34.0
- 4.33.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.21.0
- 4.20.0
- 4.19.0
- 4.18.0
- 4.17.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.1
- 4.8.6
- 4.7.5
- 4.6.0
- 4.5.11
- 4.4.0
- 4.3.1
public class IntentsClient implements BackgroundResource
Service Description: Service for managing Intents.
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 (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
Intent response = intentsClient.getIntent(name);
}
Note: close() needs to be called on the IntentsClient 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 IntentsSettings 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
IntentsSettings intentsSettings =
IntentsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
IntentsClient intentsClient = IntentsClient.create(intentsSettings);
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
IntentsSettings intentsSettings = IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
IntentsClient intentsClient = IntentsClient.create(intentsSettings);
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
IntentsSettings intentsSettings = IntentsSettings.newHttpJsonBuilder().build();
IntentsClient intentsClient = IntentsClient.create(intentsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final IntentsClient create()
Constructs an instance of IntentsClient with default settings.
Type | Description |
IntentsClient |
Type | Description |
IOException |
create(IntentsSettings settings)
public static final IntentsClient create(IntentsSettings settings)
Constructs an instance of IntentsClient, 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 |
IntentsSettings |
Type | Description |
IntentsClient |
Type | Description |
IOException |
create(IntentsStub stub)
public static final IntentsClient create(IntentsStub stub)
Constructs an instance of IntentsClient, using the given stub for making calls. This is for advanced usage - prefer using create(IntentsSettings).
Name | Description |
stub |
IntentsStub |
Type | Description |
IntentsClient |
Constructors
IntentsClient(IntentsSettings settings)
protected IntentsClient(IntentsSettings settings)
Constructs an instance of IntentsClient, 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 |
IntentsSettings |
IntentsClient(IntentsStub stub)
protected IntentsClient(IntentsStub stub)
Name | Description |
stub |
IntentsStub |
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 |
batchDeleteIntentsAsync(AgentName parent, List<Intent> intents)
public final OperationFuture<Empty,Struct> batchDeleteIntentsAsync(AgentName parent, List<Intent> intents)
Deletes intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: An Empty messageNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); List<Intent> intents = new ArrayList<>(); intentsClient.batchDeleteIntentsAsync(parent, intents).get(); }
Name | Description |
parent |
AgentName Required. The name of the agent to delete all entities types for. Supported formats: - |
intents |
List<Intent> Required. The collection of intents to delete. Only intent |
Type | Description |
OperationFuture<Empty,Struct> |
batchDeleteIntentsAsync(BatchDeleteIntentsRequest request)
public final OperationFuture<Empty,Struct> batchDeleteIntentsAsync(BatchDeleteIntentsRequest request)
Deletes intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: An Empty messageNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .addAllIntents(new ArrayList<Intent>()) .build(); intentsClient.batchDeleteIntentsAsync(request).get(); }
Name | Description |
request |
BatchDeleteIntentsRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,Struct> |
batchDeleteIntentsAsync(String parent, List<Intent> intents)
public final OperationFuture<Empty,Struct> batchDeleteIntentsAsync(String parent, List<Intent> intents)
Deletes intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: An Empty messageNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); List<Intent> intents = new ArrayList<>(); intentsClient.batchDeleteIntentsAsync(parent, intents).get(); }
Name | Description |
parent |
String Required. The name of the agent to delete all entities types for. Supported formats: - |
intents |
List<Intent> Required. The collection of intents to delete. Only intent |
Type | Description |
OperationFuture<Empty,Struct> |
batchDeleteIntentsCallable()
public final UnaryCallable<BatchDeleteIntentsRequest,Operation> batchDeleteIntentsCallable()
Deletes intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: An Empty messageNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .addAllIntents(new ArrayList<Intent>()) .build(); ApiFuture<Operation> future = intentsClient.batchDeleteIntentsCallable().futureCall(request); // Do something. future.get(); }
Type | Description |
UnaryCallable<BatchDeleteIntentsRequest,Operation> |
batchDeleteIntentsOperationCallable()
public final OperationCallable<BatchDeleteIntentsRequest,Empty,Struct> batchDeleteIntentsOperationCallable()
Deletes intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: An Empty messageNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { BatchDeleteIntentsRequest request = BatchDeleteIntentsRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .addAllIntents(new ArrayList<Intent>()) .build(); OperationFuture<Empty, Struct> future = intentsClient.batchDeleteIntentsOperationCallable().futureCall(request); // Do something. future.get(); }
Type | Description |
OperationCallable<BatchDeleteIntentsRequest,Empty,Struct> |
batchUpdateIntentsAsync(AgentName parent, IntentBatch intentBatchInline)
public final OperationFuture<BatchUpdateIntentsResponse,Struct> batchUpdateIntentsAsync(AgentName parent, IntentBatch intentBatchInline)
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); IntentBatch intentBatchInline = IntentBatch.newBuilder().build(); BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent, intentBatchInline).get(); }
Name | Description |
parent |
AgentName Required. The name of the agent to update or create intents in. Supported formats: - |
intentBatchInline |
IntentBatch The collection of intents to update or create. |
Type | Description |
OperationFuture<BatchUpdateIntentsResponse,Struct> |
batchUpdateIntentsAsync(AgentName parent, String intentBatchUri)
public final OperationFuture<BatchUpdateIntentsResponse,Struct> batchUpdateIntentsAsync(AgentName parent, String intentBatchUri)
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); String intentBatchUri = "intentBatchUri544125582"; BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent, intentBatchUri).get(); }
Name | Description |
parent |
AgentName Required. The name of the agent to update or create intents in. Supported formats: - |
intentBatchUri |
String The URI to a Google Cloud Storage file containing intents to update or create. The file format can either be a serialized proto (of IntentBatch type) or JSON object. Note: The URI must start with "gs://". |
Type | Description |
OperationFuture<BatchUpdateIntentsResponse,Struct> |
batchUpdateIntentsAsync(BatchUpdateIntentsRequest request)
public final OperationFuture<BatchUpdateIntentsResponse,Struct> batchUpdateIntentsAsync(BatchUpdateIntentsRequest request)
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { BatchUpdateIntentsRequest request = BatchUpdateIntentsRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .setIntentView(IntentView.forNumber(0)) .build(); BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(request).get(); }
Name | Description |
request |
BatchUpdateIntentsRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<BatchUpdateIntentsResponse,Struct> |
batchUpdateIntentsAsync(String parent, IntentBatch intentBatchInline)
public final OperationFuture<BatchUpdateIntentsResponse,Struct> batchUpdateIntentsAsync(String parent, IntentBatch intentBatchInline)
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); IntentBatch intentBatchInline = IntentBatch.newBuilder().build(); BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent, intentBatchInline).get(); }
Name | Description |
parent |
String Required. The name of the agent to update or create intents in. Supported formats: - |
intentBatchInline |
IntentBatch The collection of intents to update or create. |
Type | Description |
OperationFuture<BatchUpdateIntentsResponse,Struct> |
batchUpdateIntentsAsync(String parent, String intentBatchUri)
public final OperationFuture<BatchUpdateIntentsResponse,Struct> batchUpdateIntentsAsync(String parent, String intentBatchUri)
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); String intentBatchUri = "intentBatchUri544125582"; BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(parent, intentBatchUri).get(); }
Name | Description |
parent |
String Required. The name of the agent to update or create intents in. Supported formats: - |
intentBatchUri |
String The URI to a Google Cloud Storage file containing intents to update or create. The file format can either be a serialized proto (of IntentBatch type) or JSON object. Note: The URI must start with "gs://". |
Type | Description |
OperationFuture<BatchUpdateIntentsResponse,Struct> |
batchUpdateIntentsCallable()
public final UnaryCallable<BatchUpdateIntentsRequest,Operation> batchUpdateIntentsCallable()
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { BatchUpdateIntentsRequest request = BatchUpdateIntentsRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .setIntentView(IntentView.forNumber(0)) .build(); ApiFuture<Operation> future = intentsClient.batchUpdateIntentsCallable().futureCall(request); // Do something. Operation response = future.get(); }
Type | Description |
UnaryCallable<BatchUpdateIntentsRequest,Operation> |
batchUpdateIntentsOperationCallable()
public final OperationCallable<BatchUpdateIntentsRequest,BatchUpdateIntentsResponse,Struct> batchUpdateIntentsOperationCallable()
Updates/Creates multiple intents in the specified agent.
This method is a long-running
operation. The
returned Operation
type has the following method-specific fields:
- metadata
: An empty Struct
message
response
: BatchUpdateIntentsResponseNote: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) { BatchUpdateIntentsRequest request = BatchUpdateIntentsRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .setIntentView(IntentView.forNumber(0)) .build(); OperationFuture<BatchUpdateIntentsResponse, Struct> future = intentsClient.batchUpdateIntentsOperationCallable().futureCall(request); // Do something. BatchUpdateIntentsResponse response = future.get(); }
Type | Description |
OperationCallable<BatchUpdateIntentsRequest,BatchUpdateIntentsResponse,Struct> |
close()
public final void close()
createIntent(AgentName parent, Intent intent)
public final Intent createIntent(AgentName parent, Intent intent)
Creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
AgentName parent = AgentName.ofProjectName("[PROJECT]");
Intent intent = Intent.newBuilder().build();
Intent response = intentsClient.createIntent(parent, intent);
}
Name | Description |
parent |
AgentName Required. The agent to create a intent for. Supported formats: - |
intent |
Intent Required. The intent to create. |
Type | Description |
Intent |
createIntent(AgentName parent, Intent intent, String languageCode)
public final Intent createIntent(AgentName parent, Intent intent, String languageCode)
Creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
AgentName parent = AgentName.ofProjectName("[PROJECT]");
Intent intent = Intent.newBuilder().build();
String languageCode = "languageCode-2092349083";
Intent response = intentsClient.createIntent(parent, intent, languageCode);
}
Name | Description |
parent |
AgentName Required. The agent to create a intent for. Supported formats: - |
intent |
Intent Required. The intent to create. |
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
Intent |
createIntent(CreateIntentRequest request)
public final Intent createIntent(CreateIntentRequest request)
Creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
CreateIntentRequest request =
CreateIntentRequest.newBuilder()
.setParent(AgentName.ofProjectName("[PROJECT]").toString())
.setIntent(Intent.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.build();
Intent response = intentsClient.createIntent(request);
}
Name | Description |
request |
CreateIntentRequest The request object containing all of the parameters for the API call. |
Type | Description |
Intent |
createIntent(String parent, Intent intent)
public final Intent createIntent(String parent, Intent intent)
Creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String parent = AgentName.ofProjectName("[PROJECT]").toString();
Intent intent = Intent.newBuilder().build();
Intent response = intentsClient.createIntent(parent, intent);
}
Name | Description |
parent |
String Required. The agent to create a intent for. Supported formats: - |
intent |
Intent Required. The intent to create. |
Type | Description |
Intent |
createIntent(String parent, Intent intent, String languageCode)
public final Intent createIntent(String parent, Intent intent, String languageCode)
Creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String parent = AgentName.ofProjectName("[PROJECT]").toString();
Intent intent = Intent.newBuilder().build();
String languageCode = "languageCode-2092349083";
Intent response = intentsClient.createIntent(parent, intent, languageCode);
}
Name | Description |
parent |
String Required. The agent to create a intent for. Supported formats: - |
intent |
Intent Required. The intent to create. |
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
Intent |
createIntentCallable()
public final UnaryCallable<CreateIntentRequest,Intent> createIntentCallable()
Creates an intent in the specified agent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
CreateIntentRequest request =
CreateIntentRequest.newBuilder()
.setParent(AgentName.ofProjectName("[PROJECT]").toString())
.setIntent(Intent.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.build();
ApiFuture<Intent> future = intentsClient.createIntentCallable().futureCall(request);
// Do something.
Intent response = future.get();
}
Type | Description |
UnaryCallable<CreateIntentRequest,Intent> |
deleteIntent(DeleteIntentRequest request)
public final void deleteIntent(DeleteIntentRequest request)
Deletes the specified intent and its direct or indirect followup intents.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
DeleteIntentRequest request =
DeleteIntentRequest.newBuilder()
.setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
.build();
intentsClient.deleteIntent(request);
}
Name | Description |
request |
DeleteIntentRequest The request object containing all of the parameters for the API call. |
deleteIntent(IntentName name)
public final void deleteIntent(IntentName name)
Deletes the specified intent and its direct or indirect followup intents.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
intentsClient.deleteIntent(name);
}
Name | Description |
name |
IntentName Required. The name of the intent to delete. If this intent has direct or indirect followup intents, we also delete them. Supported formats: - |
deleteIntent(String name)
public final void deleteIntent(String name)
Deletes the specified intent and its direct or indirect followup intents.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString();
intentsClient.deleteIntent(name);
}
Name | Description |
name |
String Required. The name of the intent to delete. If this intent has direct or indirect followup intents, we also delete them. Supported formats: - |
deleteIntentCallable()
public final UnaryCallable<DeleteIntentRequest,Empty> deleteIntentCallable()
Deletes the specified intent and its direct or indirect followup intents.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
DeleteIntentRequest request =
DeleteIntentRequest.newBuilder()
.setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
.build();
ApiFuture<Empty> future = intentsClient.deleteIntentCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteIntentRequest,Empty> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getIntent(GetIntentRequest request)
public final Intent getIntent(GetIntentRequest request)
Retrieves the specified intent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
GetIntentRequest request =
GetIntentRequest.newBuilder()
.setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.build();
Intent response = intentsClient.getIntent(request);
}
Name | Description |
request |
GetIntentRequest The request object containing all of the parameters for the API call. |
Type | Description |
Intent |
getIntent(IntentName name)
public final Intent getIntent(IntentName name)
Retrieves the specified intent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
Intent response = intentsClient.getIntent(name);
}
Name | Description |
name |
IntentName Required. The name of the intent. Supported formats: - |
Type | Description |
Intent |
getIntent(IntentName name, String languageCode)
public final Intent getIntent(IntentName name, String languageCode)
Retrieves the specified intent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
String languageCode = "languageCode-2092349083";
Intent response = intentsClient.getIntent(name, languageCode);
}
Name | Description |
name |
IntentName Required. The name of the intent. Supported formats: - |
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
Intent |
getIntent(String name)
public final Intent getIntent(String name)
Retrieves the specified intent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString();
Intent response = intentsClient.getIntent(name);
}
Name | Description |
name |
String Required. The name of the intent. Supported formats: - |
Type | Description |
Intent |
getIntent(String name, String languageCode)
public final Intent getIntent(String name, String languageCode)
Retrieves the specified intent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString();
String languageCode = "languageCode-2092349083";
Intent response = intentsClient.getIntent(name, languageCode);
}
Name | Description |
name |
String Required. The name of the intent. Supported formats: - |
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
Intent |
getIntentCallable()
public final UnaryCallable<GetIntentRequest,Intent> getIntentCallable()
Retrieves the specified intent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
GetIntentRequest request =
GetIntentRequest.newBuilder()
.setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.build();
ApiFuture<Intent> future = intentsClient.getIntentCallable().futureCall(request);
// Do something.
Intent response = future.get();
}
Type | Description |
UnaryCallable<GetIntentRequest,Intent> |
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)
Gets information about a location.
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 (IntentsClient intentsClient = IntentsClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = intentsClient.getLocation(request);
}
Name | Description |
request |
com.google.cloud.location.GetLocationRequest The request object containing all of the parameters for the API call. |
Type | Description |
com.google.cloud.location.Location |
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()
Gets information about a location.
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 (IntentsClient intentsClient = IntentsClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = intentsClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getSettings()
public final IntentsSettings getSettings()
Type | Description |
IntentsSettings |
getStub()
public IntentsStub getStub()
Type | Description |
IntentsStub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listIntents(AgentName parent)
public final IntentsClient.ListIntentsPagedResponse listIntents(AgentName parent)
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
AgentName parent = AgentName.ofProjectName("[PROJECT]");
for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent |
AgentName Required. The agent to list all intents from. Format: Alternatively, you can specify the environment to list intents for. Format:
|
Type | Description |
IntentsClient.ListIntentsPagedResponse |
listIntents(AgentName parent, String languageCode)
public final IntentsClient.ListIntentsPagedResponse listIntents(AgentName parent, String languageCode)
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
AgentName parent = AgentName.ofProjectName("[PROJECT]");
String languageCode = "languageCode-2092349083";
for (Intent element : intentsClient.listIntents(parent, languageCode).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent |
AgentName Required. The agent to list all intents from. Format: Alternatively, you can specify the environment to list intents for. Format:
|
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
IntentsClient.ListIntentsPagedResponse |
listIntents(ListIntentsRequest request)
public final IntentsClient.ListIntentsPagedResponse listIntents(ListIntentsRequest request)
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
ListIntentsRequest request =
ListIntentsRequest.newBuilder()
.setParent(AgentName.ofProjectName("[PROJECT]").toString())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Intent element : intentsClient.listIntents(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request |
ListIntentsRequest The request object containing all of the parameters for the API call. |
Type | Description |
IntentsClient.ListIntentsPagedResponse |
listIntents(String parent)
public final IntentsClient.ListIntentsPagedResponse listIntents(String parent)
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String parent = AgentName.ofProjectName("[PROJECT]").toString();
for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent |
String Required. The agent to list all intents from. Format: Alternatively, you can specify the environment to list intents for. Format:
|
Type | Description |
IntentsClient.ListIntentsPagedResponse |
listIntents(String parent, String languageCode)
public final IntentsClient.ListIntentsPagedResponse listIntents(String parent, String languageCode)
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
String parent = AgentName.ofProjectName("[PROJECT]").toString();
String languageCode = "languageCode-2092349083";
for (Intent element : intentsClient.listIntents(parent, languageCode).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent |
String Required. The agent to list all intents from. Format: Alternatively, you can specify the environment to list intents for. Format:
|
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
IntentsClient.ListIntentsPagedResponse |
listIntentsCallable()
public final UnaryCallable<ListIntentsRequest,ListIntentsResponse> listIntentsCallable()
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
ListIntentsRequest request =
ListIntentsRequest.newBuilder()
.setParent(AgentName.ofProjectName("[PROJECT]").toString())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListIntentsResponse response = intentsClient.listIntentsCallable().call(request);
for (Intent element : response.getIntentsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListIntentsRequest,ListIntentsResponse> |
listIntentsPagedCallable()
public final UnaryCallable<ListIntentsRequest,IntentsClient.ListIntentsPagedResponse> listIntentsPagedCallable()
Returns the list of all intents in the specified agent.
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 (IntentsClient intentsClient = IntentsClient.create()) {
ListIntentsRequest request =
ListIntentsRequest.newBuilder()
.setParent(AgentName.ofProjectName("[PROJECT]").toString())
.setLanguageCode("languageCode-2092349083")
.setIntentView(IntentView.forNumber(0))
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Intent> future = intentsClient.listIntentsPagedCallable().futureCall(request);
// Do something.
for (Intent element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListIntentsRequest,ListIntentsPagedResponse> |
listLocations(ListLocationsRequest request)
public final IntentsClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)
Lists information about the supported locations for this service.
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 (IntentsClient intentsClient = IntentsClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : intentsClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request |
com.google.cloud.location.ListLocationsRequest The request object containing all of the parameters for the API call. |
Type | Description |
IntentsClient.ListLocationsPagedResponse |
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.
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 (IntentsClient intentsClient = IntentsClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = intentsClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsPagedCallable()
public final UnaryCallable<ListLocationsRequest,IntentsClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.
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 (IntentsClient intentsClient = IntentsClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future = intentsClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateIntent(Intent intent)
public final Intent updateIntent(Intent intent)
Updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
Intent intent = Intent.newBuilder().build();
Intent response = intentsClient.updateIntent(intent);
}
Name | Description |
intent |
Intent Required. The intent to update. |
Type | Description |
Intent |
updateIntent(Intent intent, FieldMask updateMask)
public final Intent updateIntent(Intent intent, FieldMask updateMask)
Updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
Intent intent = Intent.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Intent response = intentsClient.updateIntent(intent, updateMask);
}
Name | Description |
intent |
Intent Required. The intent to update. |
updateMask |
FieldMask Optional. The mask to control which fields get updated. |
Type | Description |
Intent |
updateIntent(Intent intent, String languageCode)
public final Intent updateIntent(Intent intent, String languageCode)
Updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
Intent intent = Intent.newBuilder().build();
String languageCode = "languageCode-2092349083";
Intent response = intentsClient.updateIntent(intent, languageCode);
}
Name | Description |
intent |
Intent Required. The intent to update. |
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
Type | Description |
Intent |
updateIntent(Intent intent, String languageCode, FieldMask updateMask)
public final Intent updateIntent(Intent intent, String languageCode, FieldMask updateMask)
Updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
Intent intent = Intent.newBuilder().build();
String languageCode = "languageCode-2092349083";
FieldMask updateMask = FieldMask.newBuilder().build();
Intent response = intentsClient.updateIntent(intent, languageCode, updateMask);
}
Name | Description |
intent |
Intent Required. The intent to update. |
languageCode |
String Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see Multilingual intent and entity data. |
updateMask |
FieldMask Optional. The mask to control which fields get updated. |
Type | Description |
Intent |
updateIntent(UpdateIntentRequest request)
public final Intent updateIntent(UpdateIntentRequest request)
Updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
UpdateIntentRequest request =
UpdateIntentRequest.newBuilder()
.setIntent(Intent.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setUpdateMask(FieldMask.newBuilder().build())
.setIntentView(IntentView.forNumber(0))
.build();
Intent response = intentsClient.updateIntent(request);
}
Name | Description |
request |
UpdateIntentRequest The request object containing all of the parameters for the API call. |
Type | Description |
Intent |
updateIntentCallable()
public final UnaryCallable<UpdateIntentRequest,Intent> updateIntentCallable()
Updates the specified intent.
Note: You should always train an agent prior to sending it queries. See the training documentation.
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 (IntentsClient intentsClient = IntentsClient.create()) {
UpdateIntentRequest request =
UpdateIntentRequest.newBuilder()
.setIntent(Intent.newBuilder().build())
.setLanguageCode("languageCode-2092349083")
.setUpdateMask(FieldMask.newBuilder().build())
.setIntentView(IntentView.forNumber(0))
.build();
ApiFuture<Intent> future = intentsClient.updateIntentCallable().futureCall(request);
// Do something.
Intent response = future.get();
}
Type | Description |
UnaryCallable<UpdateIntentRequest,Intent> |