@Generated(value="by gapic-generator") @BetaApi public class EntityTypesClient extends Object implements com.google.api.gax.core.BackgroundResource
When you define an entity, you can also include synonyms that all map to that entity. For example, "soft drink", "soda", "pop", and so on.
There are three types of entities:
* **System** - entities that are defined by the Dialogflow API for common data types such as date, time, currency, and so on. A system entity is represented by the `EntityType` type.
* **Developer** - entities that are defined by you that represent actionable data that is meaningful to your application. For example, you could define a `pizza.sauce` entity for red or white pizza sauce, a `pizza.cheese` entity for the different types of cheese on a pizza, a `pizza.topping` entity for different toppings, and so on. A developer entity is represented by the `EntityType` type.
* **User** - entities that are built for an individual user such as favorites, preferences, playlists, and so on. A user entity is represented by the [SessionEntityType][google.cloud.dialogflow.v2.SessionEntityType] type.
For more information about entity types, see the [Dialogflow documentation](https://cloud.google.com/dialogflow/docs/entities-overview).
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) |
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(BatchCreateEntitiesRequest request)
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities,
String languageCode)
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(String parent,
List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchCreateEntitiesAsync(String parent,
List<EntityType.Entity> entities,
String languageCode)
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.rpc.UnaryCallable<BatchCreateEntitiesRequest,com.google.longrunning.Operation> |
batchCreateEntitiesCallable()
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.rpc.OperationCallable<BatchCreateEntitiesRequest,Empty,Struct> |
batchCreateEntitiesOperationCallable()
Creates multiple new entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest request)
Deletes entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(EntityTypeName parent,
List<String> entityValues)
Deletes entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(EntityTypeName parent,
List<String> entityValues,
String languageCode)
Deletes entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(String parent,
List<String> entityValues)
Deletes entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntitiesAsync(String parent,
List<String> entityValues,
String languageCode)
Deletes entities in the specified entity type.
|
com.google.api.gax.rpc.UnaryCallable<BatchDeleteEntitiesRequest,com.google.longrunning.Operation> |
batchDeleteEntitiesCallable()
Deletes entities in the specified entity type.
|
com.google.api.gax.rpc.OperationCallable<BatchDeleteEntitiesRequest,Empty,Struct> |
batchDeleteEntitiesOperationCallable()
Deletes entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest request)
Deletes entity types in the specified agent.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntityTypesAsync(ProjectAgentName parent,
List<String> entityTypeNames)
Deletes entity types in the specified agent.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchDeleteEntityTypesAsync(String parent,
List<String> entityTypeNames)
Deletes entity types in the specified agent.
|
com.google.api.gax.rpc.UnaryCallable<BatchDeleteEntityTypesRequest,com.google.longrunning.Operation> |
batchDeleteEntityTypesCallable()
Deletes entity types in the specified agent.
|
com.google.api.gax.rpc.OperationCallable<BatchDeleteEntityTypesRequest,Empty,Struct> |
batchDeleteEntityTypesOperationCallable()
Deletes entity types in the specified agent.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest request)
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(EntityTypeName parent,
List<EntityType.Entity> entities,
String languageCode)
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(String parent,
List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<Empty,Struct> |
batchUpdateEntitiesAsync(String parent,
List<EntityType.Entity> entities,
String languageCode)
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.rpc.UnaryCallable<BatchUpdateEntitiesRequest,com.google.longrunning.Operation> |
batchUpdateEntitiesCallable()
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.rpc.OperationCallable<BatchUpdateEntitiesRequest,Empty,Struct> |
batchUpdateEntitiesOperationCallable()
Updates or creates multiple entities in the specified entity type.
|
com.google.api.gax.longrunning.OperationFuture<BatchUpdateEntityTypesResponse,Struct> |
batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest request)
Updates/Creates multiple entity types in the specified agent.
|
com.google.api.gax.rpc.UnaryCallable<BatchUpdateEntityTypesRequest,com.google.longrunning.Operation> |
batchUpdateEntityTypesCallable()
Updates/Creates multiple entity types in the specified agent.
|
com.google.api.gax.rpc.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(CreateEntityTypeRequest request)
Creates an entity type in the specified agent.
|
EntityType |
createEntityType(ProjectAgentName parent,
EntityType entityType)
Creates an entity type in the specified agent.
|
EntityType |
createEntityType(ProjectAgentName parent,
EntityType entityType,
String languageCode)
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.
|
com.google.api.gax.rpc.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.
|
com.google.api.gax.rpc.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.
|
com.google.api.gax.rpc.UnaryCallable<GetEntityTypeRequest,EntityType> |
getEntityTypeCallable()
Retrieves the specified entity type.
|
com.google.longrunning.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(ListEntityTypesRequest request)
Returns the list of all entity types in the specified agent.
|
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(ProjectAgentName parent)
Returns the list of all entity types in the specified agent.
|
EntityTypesClient.ListEntityTypesPagedResponse |
listEntityTypes(ProjectAgentName parent,
String languageCode)
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.
|
com.google.api.gax.rpc.UnaryCallable<ListEntityTypesRequest,ListEntityTypesResponse> |
listEntityTypesCallable()
Returns the list of all entity types in the specified agent.
|
com.google.api.gax.rpc.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.
|
com.google.api.gax.rpc.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 com.google.longrunning.OperationsClient getOperationsClient()
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(ProjectAgentName parent)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(String parent)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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`.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(ProjectAgentName parent, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 to list entity synonyms for. If not specified, the
agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(String parent, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 to list entity synonyms for. If not specified, the
agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListEntityTypesRequest,EntityTypesClient.ListEntityTypesPagedResponse> listEntityTypesPagedCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 com.google.api.gax.rpc.UnaryCallable<ListEntityTypesRequest,ListEntityTypesResponse> listEntityTypesCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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>`.com.google.api.gax.rpc.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>`.com.google.api.gax.rpc.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 to retrieve entity synonyms for. If not specified,
the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 to retrieve entity synonyms for. If not specified,
the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.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(ProjectAgentName parent, EntityType entityType)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityType createEntityType(String parent, EntityType entityType)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityType createEntityType(ProjectAgentName parent, EntityType entityType, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 of entity synonyms defined in `entity_type`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityType createEntityType(String parent, EntityType entityType, String languageCode)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 of entity synonyms defined in `entity_type`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final EntityType createEntityType(CreateEntityTypeRequest request)
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateEntityTypeRequest,EntityType> createEntityTypeCallable()
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.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 of entity synonyms defined in `entity_type`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.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>`.com.google.api.gax.rpc.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>`.com.google.api.gax.rpc.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.com.google.api.gax.rpc.ApiException
- if the remote call failspublic final com.google.api.gax.rpc.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 com.google.api.gax.longrunning.OperationFuture<BatchUpdateEntityTypesResponse,Struct> batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest request)
Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.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 com.google.api.gax.rpc.OperationCallable<BatchUpdateEntityTypesRequest,BatchUpdateEntityTypesResponse,Struct> batchUpdateEntityTypesOperationCallable()
Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 com.google.api.gax.rpc.UnaryCallable<BatchUpdateEntityTypesRequest,com.google.longrunning.Operation> batchUpdateEntityTypesCallable()
Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 com.google.api.gax.longrunning.OperationFuture<Empty,Struct> batchDeleteEntityTypesAsync(ProjectAgentName parent, List<String> entityTypeNames)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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`.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.OperationFuture<Empty,Struct> batchDeleteEntityTypesAsync(String parent, List<String> entityTypeNames)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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`.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.OperationFuture<Empty,Struct> batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest request)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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.com.google.api.gax.rpc.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 com.google.api.gax.rpc.OperationCallable<BatchDeleteEntityTypesRequest,Empty,Struct> batchDeleteEntityTypesOperationCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 com.google.api.gax.rpc.UnaryCallable<BatchDeleteEntityTypesRequest,com.google.longrunning.Operation> batchDeleteEntityTypesCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
Sample code:
try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) {
ProjectAgentName parent = ProjectAgentName.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 of entity synonyms defined in `entities`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 of entity synonyms defined in `entities`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.rpc.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 com.google.api.gax.rpc.UnaryCallable<BatchCreateEntitiesRequest,com.google.longrunning.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 of entity synonyms defined in `entities`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 of entity synonyms defined in `entities`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.rpc.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 com.google.api.gax.rpc.UnaryCallable<BatchUpdateEntitiesRequest,com.google.longrunning.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 com.google.api.gax.longrunning.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 canonical `values` of the entities to delete. Note that these
are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 canonical `values` of the entities to delete. Note that these
are not fully-qualified names, i.e. they don't start with `projects/<Project ID>`.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 canonical `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 of entity synonyms defined in `entities`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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 canonical `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 of entity synonyms defined in `entities`. If not
specified, the agent's default language is used. [Many
languages](https://cloud.google.com/dialogflow/docs/reference/language) are supported.
Note: languages must be enabled in the agent before they can be used.com.google.api.gax.rpc.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 com.google.api.gax.longrunning.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.com.google.api.gax.rpc.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 com.google.api.gax.rpc.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 com.google.api.gax.rpc.UnaryCallable<BatchDeleteEntitiesRequest,com.google.longrunning.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 com.google.api.gax.core.BackgroundResource
public boolean isShutdown()
isShutdown
in interface com.google.api.gax.core.BackgroundResource
public boolean isTerminated()
isTerminated
in interface com.google.api.gax.core.BackgroundResource
public void shutdownNow()
shutdownNow
in interface com.google.api.gax.core.BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface com.google.api.gax.core.BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.