@Generated(value="by gapic-generator") @BetaApi public class EntityTypesClient extends Object implements 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:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
EntityType response = entityTypesClient.getEntityType(name);
}
Note: close() needs to be called on the entityTypesClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of EntityTypesSettings to create(). For example:
To customize credentials:
EntityTypesSettings entityTypesSettings =
EntityTypesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
EntityTypesClient entityTypesClient =
EntityTypesClient.create(entityTypesSettings);
To customize the endpoint:
EntityTypesSettings entityTypesSettings =
EntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
EntityTypesClient entityTypesClient =
EntityTypesClient.create(entityTypesSettings);
Modifier and Type | Class and Description |
---|---|
static class |
EntityTypesClient.ListEntityTypesFixedSizeCollection |
static class |
EntityTypesClient.ListEntityTypesPage |
static class |
EntityTypesClient.ListEntityTypesPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
EntityTypesClient(EntityTypesSettings settings)
Constructs an instance of EntityTypesClient, using the given settings.
|
protected |
EntityTypesClient(EntityTypesStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(BatchCreateEntitiesRequest request)
Creates multiple new entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities,
String languageCode)
Creates multiple new entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(String parent,
List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(String parent,
List<EntityType.Entity> entities,
String languageCode)
Creates multiple new entities in the specified entity type.
|
UnaryCallable<BatchCreateEntitiesRequest,Operation> |
batchCreateEntitiesCallable()
Creates multiple new entities in the specified entity type.
|
OperationCallable<BatchCreateEntitiesRequest,Empty,Struct> |
batchCreateEntitiesOperationCallable()
Creates multiple new entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest request)
Deletes entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(EntityTypeName parent,
List<String> entityValues)
Deletes entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(EntityTypeName parent,
List<String> entityValues,
String languageCode)
Deletes entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(String parent,
List<String> entityValues)
Deletes entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(String parent,
List<String> entityValues,
String languageCode)
Deletes entities in the specified entity type.
|
UnaryCallable<BatchDeleteEntitiesRequest,Operation> |
batchDeleteEntitiesCallable()
Deletes entities in the specified entity type.
|
OperationCallable<BatchDeleteEntitiesRequest,Empty,Struct> |
batchDeleteEntitiesOperationCallable()
Deletes entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchDeleteEntityTypesAsync(AgentName parent,
List<String> entityTypeNames)
Deletes entity types in the specified agent.
|
OperationFuture<Empty,Struct> |
batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest request)
Deletes entity types in the specified agent.
|
OperationFuture<Empty,Struct> |
batchDeleteEntityTypesAsync(String parent,
List<String> entityTypeNames)
Deletes entity types in the specified agent.
|
UnaryCallable<BatchDeleteEntityTypesRequest,Operation> |
batchDeleteEntityTypesCallable()
Deletes entity types in the specified agent.
|
OperationCallable<BatchDeleteEntityTypesRequest,Empty,Struct> |
batchDeleteEntityTypesOperationCallable()
Deletes entity types in the specified agent.
|
OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest request)
Updates or creates multiple entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities,
String languageCode)
Updates or creates multiple entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(String parent,
List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type.
|
OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(String parent,
List<EntityType.Entity> entities,
String languageCode)
Updates or creates multiple entities in the specified entity type.
|
UnaryCallable<BatchUpdateEntitiesRequest,Operation> |
batchUpdateEntitiesCallable()
Updates or creates multiple entities in the specified entity type.
|
OperationCallable<BatchUpdateEntitiesRequest,Empty,Struct> |
batchUpdateEntitiesOperationCallable()
Updates or creates multiple entities in the specified entity type.
|
OperationFuture<BatchUpdateEntityTypesResponse,Struct> |
batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest request)
Updates/Creates multiple entity types in the specified agent.
|
UnaryCallable<BatchUpdateEntityTypesRequest,Operation> |
batchUpdateEntityTypesCallable()
Updates/Creates multiple entity types in the specified agent.
|
OperationCallable<BatchUpdateEntityTypesRequest,BatchUpdateEntityTypesResponse,Struct> |
batchUpdateEntityTypesOperationCallable()
Updates/Creates multiple entity types in the specified agent.
|
void |
close() |
static EntityTypesClient |
create()
Constructs an instance of EntityTypesClient with default settings.
|
static EntityTypesClient |
create(EntityTypesSettings settings)
Constructs an instance of EntityTypesClient, using the given settings.
|
static EntityTypesClient |
create(EntityTypesStub stub)
Constructs an instance of EntityTypesClient, using the given stub for making calls.
|
EntityType |
createEntityType(AgentName parent,
EntityType entityType)
Creates an entity type in the specified agent.
|
EntityType |
createEntityType(AgentName parent,
EntityType entityType,
String languageCode)
Creates an entity type in the specified agent.
|
EntityType |
createEntityType(CreateEntityTypeRequest request)
Creates an entity type in the specified agent.
|
EntityType |
createEntityType(String parent,
EntityType entityType)
Creates an entity type in the specified agent.
|
EntityType |
createEntityType(String parent,
EntityType entityType,
String languageCode)
Creates an entity type in the specified agent.
|
UnaryCallable<CreateEntityTypeRequest,EntityType> |
createEntityTypeCallable()
Creates an entity type in the specified agent.
|
void |
deleteEntityType(DeleteEntityTypeRequest request)
Deletes the specified entity type.
|
void |
deleteEntityType(EntityTypeName name)
Deletes the specified entity type.
|
void |
deleteEntityType(String name)
Deletes the specified entity type.
|
UnaryCallable<DeleteEntityTypeRequest,Empty> |
deleteEntityTypeCallable()
Deletes the specified entity type.
|
EntityType |
getEntityType(EntityTypeName name)
Retrieves the specified entity type.
|
EntityType |
getEntityType(EntityTypeName name,
String languageCode)
Retrieves the specified entity type.
|
EntityType |
getEntityType(GetEntityTypeRequest request)
Retrieves the specified entity type.
|
EntityType |
getEntityType(String name)
Retrieves the specified entity type.
|
EntityType |
getEntityType(String name,
String languageCode)
Retrieves the specified entity type.
|
UnaryCallable<GetEntityTypeRequest,EntityType> |
getEntityTypeCallable()
Retrieves the specified entity type.
|
OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
EntityTypesSettings |
getSettings() |
EntityTypesStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(AgentName parent)
Returns the list of all entity types in the specified agent.
|
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(AgentName parent,
String languageCode)
Returns the list of all entity types in the specified agent.
|
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(ListEntityTypesRequest request)
Returns the list of all entity types in the specified agent.
|
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(String parent)
Returns the list of all entity types in the specified agent.
|
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(String parent,
String languageCode)
Returns the list of all entity types in the specified agent.
|
UnaryCallable<ListEntityTypesRequest,ListEntityTypesResponse> |
listEntityTypesCallable()
Returns the list of all entity types in the specified agent.
|
UnaryCallable<ListEntityTypesRequest,EntityTypesClient.ListEntityTypesPagedResponse> |
listEntityTypesPagedCallable()
Returns the list of all entity types in the specified agent.
|
void |
shutdown() |
void |
shutdownNow() |
EntityType |
updateEntityType(EntityType entityType)
Updates the specified entity type.
|
EntityType |
updateEntityType(EntityType entityType,
String languageCode)
Updates the specified entity type.
|
EntityType |
updateEntityType(UpdateEntityTypeRequest request)
Updates the specified entity type.
|
UnaryCallable<UpdateEntityTypeRequest,EntityType> |
updateEntityTypeCallable()
Updates the specified entity type.
|
protected EntityTypesClient(EntityTypesSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected EntityTypesClient(EntityTypesStub stub)
public static final EntityTypesClient create() throws IOException
IOException
public static final EntityTypesClient create(EntityTypesSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final EntityTypesClient create(EntityTypesStub stub)
public final EntityTypesSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public EntityTypesStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient()
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(AgentName parent)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The agent to list all entity types from. Format: `projects/<Project
ID>/agent`.ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(String parent)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
for (EntityType element : entityTypesClient.listEntityTypes(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The agent to list all entity types from. Format: `projects/<Project
ID>/agent`.ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(AgentName parent, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
String languageCode = "";
for (EntityType element : entityTypesClient.listEntityTypes(parent, languageCode).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The agent to list all entity types from. Format: `projects/<Project
ID>/agent`.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(String parent, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
String languageCode = "";
for (EntityType element : entityTypesClient.listEntityTypes(parent.toString(), languageCode).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The agent to list all entity types from. Format: `projects/<Project
ID>/agent`.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
for (EntityType element : entityTypesClient.listEntityTypes(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListEntityTypesRequest,EntityTypesClient.ListEntityTypesPagedResponse> listEntityTypesPagedCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListEntityTypesPagedResponse> future = entityTypesClient.listEntityTypesPagedCallable().futureCall(request);
// Do something
for (EntityType element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListEntityTypesRequest,ListEntityTypesResponse> listEntityTypesCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListEntityTypesResponse response = entityTypesClient.listEntityTypesCallable().call(request);
for (EntityType element : response.getEntityTypesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final EntityType getEntityType(EntityTypeName name)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
EntityType response = entityTypesClient.getEntityType(name);
}
name
- Required. The name of the entity type. Format: `projects/<Project
ID>/agent/entityTypes/<EntityType ID>`.ApiException
- if the remote call failspublic final EntityType getEntityType(String name)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
EntityType response = entityTypesClient.getEntityType(name.toString());
}
name
- Required. The name of the entity type. Format: `projects/<Project
ID>/agent/entityTypes/<EntityType ID>`.ApiException
- if the remote call failspublic final EntityType getEntityType(EntityTypeName name, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
String languageCode = "";
EntityType response = entityTypesClient.getEntityType(name, languageCode);
}
name
- Required. The name of the entity type. Format: `projects/<Project
ID>/agent/entityTypes/<EntityType ID>`.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityType getEntityType(String name, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
String languageCode = "";
EntityType response = entityTypesClient.getEntityType(name.toString(), languageCode);
}
name
- Required. The name of the entity type. Format: `projects/<Project
ID>/agent/entityTypes/<EntityType ID>`.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityType getEntityType(GetEntityTypeRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
.setName(name.toString())
.build();
EntityType response = entityTypesClient.getEntityType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetEntityTypeRequest,EntityType> getEntityTypeCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<EntityType> future = entityTypesClient.getEntityTypeCallable().futureCall(request);
// Do something
EntityType response = future.get();
}
public final EntityType createEntityType(AgentName parent, EntityType entityType)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
EntityType response = entityTypesClient.createEntityType(parent, entityType);
}
parent
- Required. The agent to create a entity type for. Format: `projects/<Project
ID>/agent`.entityType
- Required. The entity type to create.ApiException
- if the remote call failspublic final EntityType createEntityType(String parent, EntityType entityType)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType);
}
parent
- Required. The agent to create a entity type for. Format: `projects/<Project
ID>/agent`.entityType
- Required. The entity type to create.ApiException
- if the remote call failspublic final EntityType createEntityType(AgentName parent, EntityType entityType, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
String languageCode = "";
EntityType response = entityTypesClient.createEntityType(parent, entityType, languageCode);
}
parent
- Required. The agent to create a entity type for. Format: `projects/<Project
ID>/agent`.entityType
- Required. The entity type to create.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityType createEntityType(String parent, EntityType entityType, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
String languageCode = "";
EntityType response = entityTypesClient.createEntityType(parent.toString(), entityType, languageCode);
}
parent
- Required. The agent to create a entity type for. Format: `projects/<Project
ID>/agent`.entityType
- Required. The entity type to create.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityType createEntityType(CreateEntityTypeRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
.setParent(parent.toString())
.setEntityType(entityType)
.build();
EntityType response = entityTypesClient.createEntityType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateEntityTypeRequest,EntityType> createEntityTypeCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
EntityType entityType = EntityType.newBuilder().build();
CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder()
.setParent(parent.toString())
.setEntityType(entityType)
.build();
ApiFuture<EntityType> future = entityTypesClient.createEntityTypeCallable().futureCall(request);
// Do something
EntityType response = future.get();
}
public final EntityType updateEntityType(EntityType entityType)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityType entityType = EntityType.newBuilder().build();
EntityType response = entityTypesClient.updateEntityType(entityType);
}
entityType
- Required. The entity type to update.ApiException
- if the remote call failspublic final EntityType updateEntityType(EntityType entityType, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityType entityType = EntityType.newBuilder().build();
String languageCode = "";
EntityType response = entityTypesClient.updateEntityType(entityType, languageCode);
}
entityType
- Required. The entity type to update.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call failspublic final EntityType updateEntityType(UpdateEntityTypeRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityType entityType = EntityType.newBuilder().build();
UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
.setEntityType(entityType)
.build();
EntityType response = entityTypesClient.updateEntityType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateEntityTypeRequest,EntityType> updateEntityTypeCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityType entityType = EntityType.newBuilder().build();
UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder()
.setEntityType(entityType)
.build();
ApiFuture<EntityType> future = entityTypesClient.updateEntityTypeCallable().futureCall(request);
// Do something
EntityType response = future.get();
}
public final void deleteEntityType(EntityTypeName name)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
entityTypesClient.deleteEntityType(name);
}
name
- Required. The name of the entity type to delete. Format: `projects/<Project
ID>/agent/entityTypes/<EntityType ID>`.ApiException
- if the remote call failspublic final void deleteEntityType(String name)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
entityTypesClient.deleteEntityType(name.toString());
}
name
- Required. The name of the entity type to delete. Format: `projects/<Project
ID>/agent/entityTypes/<EntityType ID>`.ApiException
- if the remote call failspublic final void deleteEntityType(DeleteEntityTypeRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
.setName(name.toString())
.build();
entityTypesClient.deleteEntityType(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<DeleteEntityTypeRequest,Empty> deleteEntityTypeCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName name = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Void> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<BatchUpdateEntityTypesResponse,Struct> batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest request)
Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
BatchUpdateEntityTypesResponse response = entityTypesClient.batchUpdateEntityTypesAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<BatchUpdateEntityTypesRequest,BatchUpdateEntityTypesResponse,Struct> batchUpdateEntityTypesOperationCallable()
Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
OperationFuture<BatchUpdateEntityTypesResponse, Struct> future = entityTypesClient.batchUpdateEntityTypesOperationCallable().futureCall(request);
// Do something
BatchUpdateEntityTypesResponse response = future.get();
}
public final UnaryCallable<BatchUpdateEntityTypesRequest,Operation> batchUpdateEntityTypesCallable()
Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<Operation> future = entityTypesClient.batchUpdateEntityTypesCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntityTypesAsync(AgentName parent, List<String> entityTypeNames)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
List<String> entityTypeNames = new ArrayList<>();
entityTypesClient.batchDeleteEntityTypesAsync(parent, entityTypeNames).get();
}
parent
- Required. The name of the agent to delete all entities types for. Format:
`projects/<Project ID>/agent`.entityTypeNames
- Required. The names entity types to delete. All names must point to the
same agent as `parent`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntityTypesAsync(String parent, List<String> entityTypeNames)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
List<String> entityTypeNames = new ArrayList<>();
entityTypesClient.batchDeleteEntityTypesAsync(parent.toString(), entityTypeNames).get();
}
parent
- Required. The name of the agent to delete all entities types for. Format:
`projects/<Project ID>/agent`.entityTypeNames
- Required. The names entity types to delete. All names must point to the
same agent as `parent`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest request)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
List<String> entityTypeNames = new ArrayList<>();
BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntityTypeNames(entityTypeNames)
.build();
entityTypesClient.batchDeleteEntityTypesAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<BatchDeleteEntityTypesRequest,Empty,Struct> batchDeleteEntityTypesOperationCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
List<String> entityTypeNames = new ArrayList<>();
BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntityTypeNames(entityTypeNames)
.build();
OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntityTypesOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<BatchDeleteEntityTypesRequest,Operation> batchDeleteEntityTypesCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
AgentName parent = AgentName.of("[PROJECT]");
List<String> entityTypeNames = new ArrayList<>();
BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntityTypeNames(entityTypeNames)
.build();
ApiFuture<Operation> future = entityTypesClient.batchDeleteEntityTypesCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchCreateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
entityTypesClient.batchCreateEntitiesAsync(parent, entities).get();
}
parent
- Required. The name of the entity type to create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to create.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchCreateEntitiesAsync(String parent, List<EntityType.Entity> entities)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
entityTypesClient.batchCreateEntitiesAsync(parent.toString(), entities).get();
}
parent
- Required. The name of the entity type to create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to create.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchCreateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities, String languageCode)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
String languageCode = "";
entityTypesClient.batchCreateEntitiesAsync(parent, entities, languageCode).get();
}
parent
- Required. The name of the entity type to create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to create.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchCreateEntitiesAsync(String parent, List<EntityType.Entity> entities, String languageCode)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
String languageCode = "";
entityTypesClient.batchCreateEntitiesAsync(parent.toString(), entities, languageCode).get();
}
parent
- Required. The name of the entity type to create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to create.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchCreateEntitiesAsync(BatchCreateEntitiesRequest request)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
BatchCreateEntitiesRequest request = BatchCreateEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntities(entities)
.build();
entityTypesClient.batchCreateEntitiesAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<BatchCreateEntitiesRequest,Empty,Struct> batchCreateEntitiesOperationCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
BatchCreateEntitiesRequest request = BatchCreateEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntities(entities)
.build();
OperationFuture<Empty, Struct> future = entityTypesClient.batchCreateEntitiesOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<BatchCreateEntitiesRequest,Operation> batchCreateEntitiesCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
BatchCreateEntitiesRequest request = BatchCreateEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntities(entities)
.build();
ApiFuture<Operation> future = entityTypesClient.batchCreateEntitiesCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchUpdateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
entityTypesClient.batchUpdateEntitiesAsync(parent, entities).get();
}
parent
- Required. The name of the entity type to update or create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to update or create.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchUpdateEntitiesAsync(String parent, List<EntityType.Entity> entities)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
entityTypesClient.batchUpdateEntitiesAsync(parent.toString(), entities).get();
}
parent
- Required. The name of the entity type to update or create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to update or create.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchUpdateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities, String languageCode)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
String languageCode = "";
entityTypesClient.batchUpdateEntitiesAsync(parent, entities, languageCode).get();
}
parent
- Required. The name of the entity type to update or create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to update or create.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchUpdateEntitiesAsync(String parent, List<EntityType.Entity> entities, String languageCode)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
String languageCode = "";
entityTypesClient.batchUpdateEntitiesAsync(parent.toString(), entities, languageCode).get();
}
parent
- Required. The name of the entity type to update or create entities in. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entities
- Required. The entities to update or create.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest request)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
BatchUpdateEntitiesRequest request = BatchUpdateEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntities(entities)
.build();
entityTypesClient.batchUpdateEntitiesAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<BatchUpdateEntitiesRequest,Empty,Struct> batchUpdateEntitiesOperationCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
BatchUpdateEntitiesRequest request = BatchUpdateEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntities(entities)
.build();
OperationFuture<Empty, Struct> future = entityTypesClient.batchUpdateEntitiesOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<BatchUpdateEntitiesRequest,Operation> batchUpdateEntitiesCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<EntityType.Entity> entities = new ArrayList<>();
BatchUpdateEntitiesRequest request = BatchUpdateEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntities(entities)
.build();
ApiFuture<Operation> future = entityTypesClient.batchUpdateEntitiesCallable().futureCall(request);
// Do something
future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntitiesAsync(EntityTypeName parent, List<String> entityValues)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues).get();
}
parent
- Required. The name of the entity type to delete entries for. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entityValues
- Required. The reference `values` of the entities to delete. Note that these
are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntitiesAsync(String parent, List<String> entityValues)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
entityTypesClient.batchDeleteEntitiesAsync(parent.toString(), entityValues).get();
}
parent
- Required. The name of the entity type to delete entries for. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entityValues
- Required. The reference `values` of the entities to delete. Note that these
are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntitiesAsync(EntityTypeName parent, List<String> entityValues, String languageCode)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
String languageCode = "";
entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues, languageCode).get();
}
parent
- Required. The name of the entity type to delete entries for. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entityValues
- Required. The reference `values` of the entities to delete. Note that these
are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntitiesAsync(String parent, List<String> entityValues, String languageCode)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
String languageCode = "";
entityTypesClient.batchDeleteEntitiesAsync(parent.toString(), entityValues, languageCode).get();
}
parent
- Required. The name of the entity type to delete entries for. Format:
`projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.entityValues
- Required. The reference `values` of the entities to delete. Note that these
are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.languageCode
- 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](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,Struct> batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest request)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntityValues(entityValues)
.build();
entityTypesClient.batchDeleteEntitiesAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<BatchDeleteEntitiesRequest,Empty,Struct> batchDeleteEntitiesOperationCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntityValues(entityValues)
.build();
OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntitiesOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<BatchDeleteEntitiesRequest,Operation> batchDeleteEntitiesCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
EntityTypeName parent = EntityTypeName.of("[PROJECT]", "[ENTITY_TYPE]");
List<String> entityValues = new ArrayList<>();
BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder()
.setParent(parent.toString())
.addAllEntityValues(entityValues)
.build();
ApiFuture<Operation> future = entityTypesClient.batchDeleteEntitiesCallable().futureCall(request);
// Do something
future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2021 Google LLC. All rights reserved.