Class EntityTypesClient
- java.lang.Object
-
- com.google.cloud.dialogflow.v2.EntityTypesClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class EntityTypesClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Service for managing [EntityTypes][google.cloud.dialogflow.v2.EntityType].This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[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:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of EntityTypesSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library EntityTypesSettings entityTypesSettings = EntityTypesSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library EntityTypesSettings entityTypesSettings = EntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build(); EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library EntityTypesSettings entityTypesSettings = EntityTypesSettings.newHttpJsonBuilder().build(); EntityTypesClient entityTypesClient = EntityTypesClient.create(entityTypesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntityTypesClient.ListEntityTypesFixedSizeCollection
static class
EntityTypesClient.ListEntityTypesPage
static class
EntityTypesClient.ListEntityTypesPagedResponse
static class
EntityTypesClient.ListLocationsFixedSizeCollection
static class
EntityTypesClient.ListLocationsPage
static class
EntityTypesClient.ListLocationsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityTypesClient(EntityTypesSettings settings)
Constructs an instance of EntityTypesClient, using the given settings.protected
EntityTypesClient(EntityTypesStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchCreateEntitiesAsync(BatchCreateEntitiesRequest request)
Creates multiple new entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchCreateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.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<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchCreateEntitiesAsync(String parent, List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.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,com.google.protobuf.Empty,com.google.protobuf.Struct>
batchCreateEntitiesOperationCallable()
Creates multiple new entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest request)
Deletes entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntitiesAsync(EntityTypeName parent, List<String> entityValues)
Deletes entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntitiesAsync(EntityTypeName parent, List<String> entityValues, String languageCode)
Deletes entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntitiesAsync(String parent, List<String> entityValues)
Deletes entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.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,com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntitiesOperationCallable()
Deletes entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntityTypesAsync(AgentName parent, List<String> entityTypeNames)
Deletes entity types in the specified agent.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest request)
Deletes entity types in the specified agent.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.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,com.google.protobuf.Empty,com.google.protobuf.Struct>
batchDeleteEntityTypesOperationCallable()
Deletes entity types in the specified agent.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest request)
Updates or creates multiple entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchUpdateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.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<com.google.protobuf.Empty,com.google.protobuf.Struct>
batchUpdateEntitiesAsync(String parent, List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.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,com.google.protobuf.Empty,com.google.protobuf.Struct>
batchUpdateEntitiesOperationCallable()
Updates or creates multiple entities in the specified entity type.com.google.api.gax.longrunning.OperationFuture<BatchUpdateEntityTypesResponse,com.google.protobuf.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,com.google.protobuf.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.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,com.google.protobuf.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.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.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(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.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.EntityTypesClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,EntityTypesClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.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.
-
-
-
Constructor Detail
-
EntityTypesClient
protected EntityTypesClient(EntityTypesSettings settings) throws IOException
Constructs an instance of EntityTypesClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
EntityTypesClient
protected EntityTypesClient(EntityTypesStub stub)
-
-
Method Detail
-
create
public static final EntityTypesClient create() throws IOException
Constructs an instance of EntityTypesClient with default settings.- Throws:
IOException
-
create
public static final EntityTypesClient create(EntityTypesSettings settings) throws IOException
Constructs an instance of EntityTypesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final EntityTypesClient create(EntityTypesStub stub)
Constructs an instance of EntityTypesClient, using the given stub for making calls. This is for advanced usage - prefer using create(EntityTypesSettings).
-
getSettings
public final EntityTypesSettings getSettings()
-
getStub
public EntityTypesStub getStub()
-
getOperationsClient
public final 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.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
listEntityTypes
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(AgentName parent)
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The agent to list all entity types from. Format: `projects/<Project ID>/agent`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEntityTypes
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(String parent)
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); for (EntityType element : entityTypesClient.listEntityTypes(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The agent to list all entity types from. Format: `projects/<Project ID>/agent`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEntityTypes
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(AgentName parent, String languageCode)
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); String languageCode = "languageCode-2092349083"; for (EntityType element : entityTypesClient.listEntityTypes(parent, languageCode).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEntityTypes
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(String parent, String languageCode)
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); String languageCode = "languageCode-2092349083"; for (EntityType element : entityTypesClient.listEntityTypes(parent, languageCode).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEntityTypes
public final EntityTypesClient.ListEntityTypesPagedResponse listEntityTypes(ListEntityTypesRequest request)
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (EntityType element : entityTypesClient.listEntityTypes(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listEntityTypesPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListEntityTypesRequest,EntityTypesClient.ListEntityTypesPagedResponse> listEntityTypesPagedCallable()
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<EntityType> future = entityTypesClient.listEntityTypesPagedCallable().futureCall(request); // Do something. for (EntityType element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listEntityTypesCallable
public final com.google.api.gax.rpc.UnaryCallable<ListEntityTypesRequest,ListEntityTypesResponse> listEntityTypesCallable()
Returns the list of all entity types in the specified agent.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { ListEntityTypesRequest request = ListEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setPageSize(883849137) .setPageToken("pageToken873572522") .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; } } }
-
getEntityType
public final EntityType getEntityType(EntityTypeName name)
Retrieves the specified entity type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); EntityType response = entityTypesClient.getEntityType(name); }
- Parameters:
name
- Required. The name of the entity type. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEntityType
public final EntityType getEntityType(String name)
Retrieves the specified entity type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); EntityType response = entityTypesClient.getEntityType(name); }
- Parameters:
name
- Required. The name of the entity type. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEntityType
public final EntityType getEntityType(EntityTypeName name, String languageCode)
Retrieves the specified entity type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); String languageCode = "languageCode-2092349083"; EntityType response = entityTypesClient.getEntityType(name, languageCode); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEntityType
public final EntityType getEntityType(String name, String languageCode)
Retrieves the specified entity type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); String languageCode = "languageCode-2092349083"; EntityType response = entityTypesClient.getEntityType(name, languageCode); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEntityType
public final EntityType getEntityType(GetEntityTypeRequest request)
Retrieves the specified entity type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder() .setName( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .setLanguageCode("languageCode-2092349083") .build(); EntityType response = entityTypesClient.getEntityType(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getEntityTypeCallable
public final com.google.api.gax.rpc.UnaryCallable<GetEntityTypeRequest,EntityType> getEntityTypeCallable()
Retrieves the specified entity type.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { GetEntityTypeRequest request = GetEntityTypeRequest.newBuilder() .setName( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .setLanguageCode("languageCode-2092349083") .build(); ApiFuture<EntityType> future = entityTypesClient.getEntityTypeCallable().futureCall(request); // Do something. EntityType response = future.get(); }
-
createEntityType
public final EntityType createEntityType(AgentName parent, EntityType entityType)
Creates an entity type in the specified agent.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); EntityType entityType = EntityType.newBuilder().build(); EntityType response = entityTypesClient.createEntityType(parent, entityType); }
- Parameters:
parent
- Required. The agent to create a entity type for. Format: `projects/<Project ID>/agent`.entityType
- Required. The entity type to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEntityType
public final EntityType createEntityType(String parent, EntityType entityType)
Creates an entity type in the specified agent.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); EntityType entityType = EntityType.newBuilder().build(); EntityType response = entityTypesClient.createEntityType(parent, entityType); }
- Parameters:
parent
- Required. The agent to create a entity type for. Format: `projects/<Project ID>/agent`.entityType
- Required. The entity type to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEntityType
public final EntityType createEntityType(AgentName parent, EntityType entityType, String languageCode)
Creates an entity type in the specified agent.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); EntityType entityType = EntityType.newBuilder().build(); String languageCode = "languageCode-2092349083"; EntityType response = entityTypesClient.createEntityType(parent, entityType, languageCode); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEntityType
public final EntityType createEntityType(String parent, EntityType entityType, String languageCode)
Creates an entity type in the specified agent.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); EntityType entityType = EntityType.newBuilder().build(); String languageCode = "languageCode-2092349083"; EntityType response = entityTypesClient.createEntityType(parent, entityType, languageCode); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEntityType
public final EntityType createEntityType(CreateEntityTypeRequest request)
Creates an entity type in the specified agent.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setEntityType(EntityType.newBuilder().build()) .setLanguageCode("languageCode-2092349083") .build(); EntityType response = entityTypesClient.createEntityType(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createEntityTypeCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateEntityTypeRequest,EntityType> createEntityTypeCallable()
Creates an entity type in the specified agent.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { CreateEntityTypeRequest request = CreateEntityTypeRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setEntityType(EntityType.newBuilder().build()) .setLanguageCode("languageCode-2092349083") .build(); ApiFuture<EntityType> future = entityTypesClient.createEntityTypeCallable().futureCall(request); // Do something. EntityType response = future.get(); }
-
updateEntityType
public final EntityType updateEntityType(EntityType entityType)
Updates the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityType entityType = EntityType.newBuilder().build(); EntityType response = entityTypesClient.updateEntityType(entityType); }
- Parameters:
entityType
- Required. The entity type to update.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateEntityType
public final EntityType updateEntityType(EntityType entityType, String languageCode)
Updates the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityType entityType = EntityType.newBuilder().build(); String languageCode = "languageCode-2092349083"; EntityType response = entityTypesClient.updateEntityType(entityType, languageCode); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateEntityType
public final EntityType updateEntityType(UpdateEntityTypeRequest request)
Updates the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder() .setEntityType(EntityType.newBuilder().build()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); EntityType response = entityTypesClient.updateEntityType(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
updateEntityTypeCallable
public final com.google.api.gax.rpc.UnaryCallable<UpdateEntityTypeRequest,EntityType> updateEntityTypeCallable()
Updates the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { UpdateEntityTypeRequest request = UpdateEntityTypeRequest.newBuilder() .setEntityType(EntityType.newBuilder().build()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<EntityType> future = entityTypesClient.updateEntityTypeCallable().futureCall(request); // Do something. EntityType response = future.get(); }
-
deleteEntityType
public final void deleteEntityType(EntityTypeName name)
Deletes the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); entityTypesClient.deleteEntityType(name); }
- Parameters:
name
- Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEntityType
public final void deleteEntityType(String name)
Deletes the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String name = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); entityTypesClient.deleteEntityType(name); }
- Parameters:
name
- Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEntityType
public final void deleteEntityType(DeleteEntityTypeRequest request)
Deletes the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder() .setName( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .build(); entityTypesClient.deleteEntityType(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteEntityTypeCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteEntityTypeRequest,com.google.protobuf.Empty> deleteEntityTypeCallable()
Deletes the specified entity type.Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { DeleteEntityTypeRequest request = DeleteEntityTypeRequest.newBuilder() .setName( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .build(); ApiFuture<Empty> future = entityTypesClient.deleteEntityTypeCallable().futureCall(request); // Do something. future.get(); }
-
batchUpdateEntityTypesAsync
public final com.google.api.gax.longrunning.OperationFuture<BatchUpdateEntityTypesResponse,com.google.protobuf.Struct> batchUpdateEntityTypesAsync(BatchUpdateEntityTypesRequest request)
Updates/Creates multiple entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); BatchUpdateEntityTypesResponse response = entityTypesClient.batchUpdateEntityTypesAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateEntityTypesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchUpdateEntityTypesRequest,BatchUpdateEntityTypesResponse,com.google.protobuf.Struct> batchUpdateEntityTypesOperationCallable()
Updates/Creates multiple entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); OperationFuture<BatchUpdateEntityTypesResponse, Struct> future = entityTypesClient.batchUpdateEntityTypesOperationCallable().futureCall(request); // Do something. BatchUpdateEntityTypesResponse response = future.get(); }
-
batchUpdateEntityTypesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchUpdateEntityTypesRequest,com.google.longrunning.Operation> batchUpdateEntityTypesCallable()
Updates/Creates multiple entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchUpdateEntityTypesRequest request = BatchUpdateEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Operation> future = entityTypesClient.batchUpdateEntityTypesCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
batchDeleteEntityTypesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntityTypesAsync(AgentName parent, List<String> entityTypeNames)
Deletes entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { AgentName parent = AgentName.ofProjectName("[PROJECT]"); List<String> entityTypeNames = new ArrayList<>(); entityTypesClient.batchDeleteEntityTypesAsync(parent, entityTypeNames).get(); }
- Parameters:
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`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntityTypesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntityTypesAsync(String parent, List<String> entityTypeNames)
Deletes entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = AgentName.ofProjectName("[PROJECT]").toString(); List<String> entityTypeNames = new ArrayList<>(); entityTypesClient.batchDeleteEntityTypesAsync(parent, entityTypeNames).get(); }
- Parameters:
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`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntityTypesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntityTypesAsync(BatchDeleteEntityTypesRequest request)
Deletes entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .addAllEntityTypeNames(new ArrayList<String>()) .build(); entityTypesClient.batchDeleteEntityTypesAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntityTypesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchDeleteEntityTypesRequest,com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntityTypesOperationCallable()
Deletes entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .addAllEntityTypeNames(new ArrayList<String>()) .build(); OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntityTypesOperationCallable().futureCall(request); // Do something. future.get(); }
-
batchDeleteEntityTypesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchDeleteEntityTypesRequest,com.google.longrunning.Operation> batchDeleteEntityTypesCallable()
Deletes entity types in the specified agent.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchDeleteEntityTypesRequest request = BatchDeleteEntityTypesRequest.newBuilder() .setParent(AgentName.ofProjectName("[PROJECT]").toString()) .addAllEntityTypeNames(new ArrayList<String>()) .build(); ApiFuture<Operation> future = entityTypesClient.batchDeleteEntityTypesCallable().futureCall(request); // Do something. future.get(); }
-
batchCreateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchCreateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); List<EntityType.Entity> entities = new ArrayList<>(); entityTypesClient.batchCreateEntitiesAsync(parent, entities).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchCreateEntitiesAsync(String parent, List<EntityType.Entity> entities)
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); List<EntityType.Entity> entities = new ArrayList<>(); entityTypesClient.batchCreateEntitiesAsync(parent, entities).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchCreateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities, String languageCode)
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); List<EntityType.Entity> entities = new ArrayList<>(); String languageCode = "languageCode-2092349083"; entityTypesClient.batchCreateEntitiesAsync(parent, entities, languageCode).get(); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchCreateEntitiesAsync(String parent, List<EntityType.Entity> entities, String languageCode)
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); List<EntityType.Entity> entities = new ArrayList<>(); String languageCode = "languageCode-2092349083"; entityTypesClient.batchCreateEntitiesAsync(parent, entities, languageCode).get(); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchCreateEntitiesAsync(BatchCreateEntitiesRequest request)
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchCreateEntitiesRequest request = BatchCreateEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntities(new ArrayList<EntityType.Entity>()) .setLanguageCode("languageCode-2092349083") .build(); entityTypesClient.batchCreateEntitiesAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchCreateEntitiesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchCreateEntitiesRequest,com.google.protobuf.Empty,com.google.protobuf.Struct> batchCreateEntitiesOperationCallable()
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchCreateEntitiesRequest request = BatchCreateEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntities(new ArrayList<EntityType.Entity>()) .setLanguageCode("languageCode-2092349083") .build(); OperationFuture<Empty, Struct> future = entityTypesClient.batchCreateEntitiesOperationCallable().futureCall(request); // Do something. future.get(); }
-
batchCreateEntitiesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchCreateEntitiesRequest,com.google.longrunning.Operation> batchCreateEntitiesCallable()
Creates multiple new entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchCreateEntitiesRequest request = BatchCreateEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntities(new ArrayList<EntityType.Entity>()) .setLanguageCode("languageCode-2092349083") .build(); ApiFuture<Operation> future = entityTypesClient.batchCreateEntitiesCallable().futureCall(request); // Do something. future.get(); }
-
batchUpdateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchUpdateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); List<EntityType.Entity> entities = new ArrayList<>(); entityTypesClient.batchUpdateEntitiesAsync(parent, entities).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchUpdateEntitiesAsync(String parent, List<EntityType.Entity> entities)
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); List<EntityType.Entity> entities = new ArrayList<>(); entityTypesClient.batchUpdateEntitiesAsync(parent, entities).get(); }
- Parameters:
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.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchUpdateEntitiesAsync(EntityTypeName parent, List<EntityType.Entity> entities, String languageCode)
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); List<EntityType.Entity> entities = new ArrayList<>(); String languageCode = "languageCode-2092349083"; entityTypesClient.batchUpdateEntitiesAsync(parent, entities, languageCode).get(); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchUpdateEntitiesAsync(String parent, List<EntityType.Entity> entities, String languageCode)
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); List<EntityType.Entity> entities = new ArrayList<>(); String languageCode = "languageCode-2092349083"; entityTypesClient.batchUpdateEntitiesAsync(parent, entities, languageCode).get(); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchUpdateEntitiesAsync(BatchUpdateEntitiesRequest request)
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchUpdateEntitiesRequest request = BatchUpdateEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntities(new ArrayList<EntityType.Entity>()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); entityTypesClient.batchUpdateEntitiesAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchUpdateEntitiesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchUpdateEntitiesRequest,com.google.protobuf.Empty,com.google.protobuf.Struct> batchUpdateEntitiesOperationCallable()
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchUpdateEntitiesRequest request = BatchUpdateEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntities(new ArrayList<EntityType.Entity>()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); OperationFuture<Empty, Struct> future = entityTypesClient.batchUpdateEntitiesOperationCallable().futureCall(request); // Do something. future.get(); }
-
batchUpdateEntitiesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchUpdateEntitiesRequest,com.google.longrunning.Operation> batchUpdateEntitiesCallable()
Updates or creates multiple entities in the specified entity type. This method does not affect entities in the entity type that aren't explicitly specified in the request.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchUpdateEntitiesRequest request = BatchUpdateEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntities(new ArrayList<EntityType.Entity>()) .setLanguageCode("languageCode-2092349083") .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Operation> future = entityTypesClient.batchUpdateEntitiesCallable().futureCall(request); // Do something. future.get(); }
-
batchDeleteEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntitiesAsync(EntityTypeName parent, List<String> entityValues)
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); List<String> entityValues = new ArrayList<>(); entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues).get(); }
- Parameters:
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>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntitiesAsync(String parent, List<String> entityValues)
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); List<String> entityValues = new ArrayList<>(); entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues).get(); }
- Parameters:
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>`.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntitiesAsync(EntityTypeName parent, List<String> entityValues, String languageCode)
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { EntityTypeName parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]"); List<String> entityValues = new ArrayList<>(); String languageCode = "languageCode-2092349083"; entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues, languageCode).get(); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntitiesAsync(String parent, List<String> entityValues, String languageCode)
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { String parent = EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString(); List<String> entityValues = new ArrayList<>(); String languageCode = "languageCode-2092349083"; entityTypesClient.batchDeleteEntitiesAsync(parent, entityValues, languageCode).get(); }
- Parameters:
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).- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntitiesAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntitiesAsync(BatchDeleteEntitiesRequest request)
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntityValues(new ArrayList<String>()) .setLanguageCode("languageCode-2092349083") .build(); entityTypesClient.batchDeleteEntitiesAsync(request).get(); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
batchDeleteEntitiesOperationCallable
public final com.google.api.gax.rpc.OperationCallable<BatchDeleteEntitiesRequest,com.google.protobuf.Empty,com.google.protobuf.Struct> batchDeleteEntitiesOperationCallable()
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntityValues(new ArrayList<String>()) .setLanguageCode("languageCode-2092349083") .build(); OperationFuture<Empty, Struct> future = entityTypesClient.batchDeleteEntitiesOperationCallable().futureCall(request); // Do something. future.get(); }
-
batchDeleteEntitiesCallable
public final com.google.api.gax.rpc.UnaryCallable<BatchDeleteEntitiesRequest,com.google.longrunning.Operation> batchDeleteEntitiesCallable()
Deletes entities in the specified entity type.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { BatchDeleteEntitiesRequest request = BatchDeleteEntitiesRequest.newBuilder() .setParent( EntityTypeName.ofProjectEntityTypeName("[PROJECT]", "[ENTITY_TYPE]").toString()) .addAllEntityValues(new ArrayList<String>()) .setLanguageCode("languageCode-2092349083") .build(); ApiFuture<Operation> future = entityTypesClient.batchDeleteEntitiesCallable().futureCall(request); // Do something. future.get(); }
-
listLocations
public final EntityTypesClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : entityTypesClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,EntityTypesClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = entityTypesClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = entityTypesClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = entityTypesClient.getLocation(request); }
- Parameters:
request
- The request object containing all of the parameters for the API call.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = entityTypesClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-