@Generated(value="by gapic-generator-java") public class EnterpriseKnowledgeGraphServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
EntityReconciliationJob entityReconciliationJob =
EntityReconciliationJob.newBuilder().build();
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.createEntityReconciliationJob(
parent, entityReconciliationJob);
}
Note: close() needs to be called on the EnterpriseKnowledgeGraphServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
| CreateEntityReconciliationJob | Creates a EntityReconciliationJob. A EntityReconciliationJob once created will right away be attempted to start. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| GetEntityReconciliationJob | Gets a EntityReconciliationJob. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| ListEntityReconciliationJobs | Lists Entity Reconciliation Jobs. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| CancelEntityReconciliationJob | Cancels a EntityReconciliationJob. Success of cancellation is not guaranteed. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| DeleteEntityReconciliationJob | Deletes a EntityReconciliationJob. It only deletes the job when the job state is in FAILED, SUCCEEDED, and CANCELLED. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| Lookup | Finds the Cloud KG entities with CKG ID(s). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| Search | Searches the Cloud KG entities with entity name. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| LookupPublicKg | Finds the public KG entities with public KG ID(s). |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
| SearchPublicKg | Searches the public KG entities with entity name. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of EnterpriseKnowledgeGraphServiceSettings 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
EnterpriseKnowledgeGraphServiceSettings enterpriseKnowledgeGraphServiceSettings =
EnterpriseKnowledgeGraphServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create(enterpriseKnowledgeGraphServiceSettings);
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
EnterpriseKnowledgeGraphServiceSettings enterpriseKnowledgeGraphServiceSettings =
EnterpriseKnowledgeGraphServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create(enterpriseKnowledgeGraphServiceSettings);
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
EnterpriseKnowledgeGraphServiceSettings enterpriseKnowledgeGraphServiceSettings =
EnterpriseKnowledgeGraphServiceSettings.newHttpJsonBuilder().build();
EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create(enterpriseKnowledgeGraphServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsFixedSizeCollection |
static class |
EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsPage |
static class |
EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
EnterpriseKnowledgeGraphServiceClient(EnterpriseKnowledgeGraphServiceSettings settings)
Constructs an instance of EnterpriseKnowledgeGraphServiceClient, using the given settings.
|
protected |
EnterpriseKnowledgeGraphServiceClient(EnterpriseKnowledgeGraphServiceStub stub) |
protected EnterpriseKnowledgeGraphServiceClient(EnterpriseKnowledgeGraphServiceSettings settings) throws IOException
IOExceptionprotected EnterpriseKnowledgeGraphServiceClient(EnterpriseKnowledgeGraphServiceStub stub)
public static final EnterpriseKnowledgeGraphServiceClient create() throws IOException
IOExceptionpublic static final EnterpriseKnowledgeGraphServiceClient create(EnterpriseKnowledgeGraphServiceSettings settings) throws IOException
IOExceptionpublic static final EnterpriseKnowledgeGraphServiceClient create(EnterpriseKnowledgeGraphServiceStub stub)
public final EnterpriseKnowledgeGraphServiceSettings getSettings()
public EnterpriseKnowledgeGraphServiceStub getStub()
public final EntityReconciliationJob createEntityReconciliationJob(LocationName parent, EntityReconciliationJob entityReconciliationJob)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
EntityReconciliationJob entityReconciliationJob =
EntityReconciliationJob.newBuilder().build();
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.createEntityReconciliationJob(
parent, entityReconciliationJob);
}
parent - Required. The resource name of the Location to create the EntityReconciliationJob
in. Format: `projects/{project}/locations/{location}`entityReconciliationJob - Required. The EntityReconciliationJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EntityReconciliationJob createEntityReconciliationJob(String parent, EntityReconciliationJob entityReconciliationJob)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
EntityReconciliationJob entityReconciliationJob =
EntityReconciliationJob.newBuilder().build();
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.createEntityReconciliationJob(
parent, entityReconciliationJob);
}
parent - Required. The resource name of the Location to create the EntityReconciliationJob
in. Format: `projects/{project}/locations/{location}`entityReconciliationJob - Required. The EntityReconciliationJob to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final EntityReconciliationJob createEntityReconciliationJob(CreateEntityReconciliationJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
CreateEntityReconciliationJobRequest request =
CreateEntityReconciliationJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEntityReconciliationJob(EntityReconciliationJob.newBuilder().build())
.build();
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.createEntityReconciliationJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateEntityReconciliationJobRequest,EntityReconciliationJob> createEntityReconciliationJobCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
CreateEntityReconciliationJobRequest request =
CreateEntityReconciliationJobRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setEntityReconciliationJob(EntityReconciliationJob.newBuilder().build())
.build();
ApiFuture<EntityReconciliationJob> future =
enterpriseKnowledgeGraphServiceClient
.createEntityReconciliationJobCallable()
.futureCall(request);
// Do something.
EntityReconciliationJob response = future.get();
}
public final EntityReconciliationJob getEntityReconciliationJob(EntityReconciliationJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
EntityReconciliationJobName name =
EntityReconciliationJobName.of("[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]");
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.getEntityReconciliationJob(name);
}
name - Required. The name of the EntityReconciliationJob resource. Format:
`projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final EntityReconciliationJob getEntityReconciliationJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String name =
EntityReconciliationJobName.of("[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString();
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.getEntityReconciliationJob(name);
}
name - Required. The name of the EntityReconciliationJob resource. Format:
`projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final EntityReconciliationJob getEntityReconciliationJob(GetEntityReconciliationJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
GetEntityReconciliationJobRequest request =
GetEntityReconciliationJobRequest.newBuilder()
.setName(
EntityReconciliationJobName.of(
"[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString())
.build();
EntityReconciliationJob response =
enterpriseKnowledgeGraphServiceClient.getEntityReconciliationJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetEntityReconciliationJobRequest,EntityReconciliationJob> getEntityReconciliationJobCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
GetEntityReconciliationJobRequest request =
GetEntityReconciliationJobRequest.newBuilder()
.setName(
EntityReconciliationJobName.of(
"[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString())
.build();
ApiFuture<EntityReconciliationJob> future =
enterpriseKnowledgeGraphServiceClient
.getEntityReconciliationJobCallable()
.futureCall(request);
// Do something.
EntityReconciliationJob response = future.get();
}
public final EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsPagedResponse listEntityReconciliationJobs(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (EntityReconciliationJob element :
enterpriseKnowledgeGraphServiceClient.listEntityReconciliationJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the EntityReconciliationJob's parent resource. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsPagedResponse listEntityReconciliationJobs(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (EntityReconciliationJob element :
enterpriseKnowledgeGraphServiceClient.listEntityReconciliationJobs(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the EntityReconciliationJob's parent resource. Format:
`projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsPagedResponse listEntityReconciliationJobs(ListEntityReconciliationJobsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
ListEntityReconciliationJobsRequest request =
ListEntityReconciliationJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (EntityReconciliationJob element :
enterpriseKnowledgeGraphServiceClient
.listEntityReconciliationJobs(request)
.iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListEntityReconciliationJobsRequest,EnterpriseKnowledgeGraphServiceClient.ListEntityReconciliationJobsPagedResponse> listEntityReconciliationJobsPagedCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
ListEntityReconciliationJobsRequest request =
ListEntityReconciliationJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<EntityReconciliationJob> future =
enterpriseKnowledgeGraphServiceClient
.listEntityReconciliationJobsPagedCallable()
.futureCall(request);
// Do something.
for (EntityReconciliationJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListEntityReconciliationJobsRequest,ListEntityReconciliationJobsResponse> listEntityReconciliationJobsCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
ListEntityReconciliationJobsRequest request =
ListEntityReconciliationJobsRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListEntityReconciliationJobsResponse response =
enterpriseKnowledgeGraphServiceClient
.listEntityReconciliationJobsCallable()
.call(request);
for (EntityReconciliationJob element : response.getEntityReconciliationJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void cancelEntityReconciliationJob(EntityReconciliationJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
EntityReconciliationJobName name =
EntityReconciliationJobName.of("[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]");
enterpriseKnowledgeGraphServiceClient.cancelEntityReconciliationJob(name);
}
name - Required. The name of the EntityReconciliationJob resource. Format:
`projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelEntityReconciliationJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String name =
EntityReconciliationJobName.of("[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString();
enterpriseKnowledgeGraphServiceClient.cancelEntityReconciliationJob(name);
}
name - Required. The name of the EntityReconciliationJob resource. Format:
`projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void cancelEntityReconciliationJob(CancelEntityReconciliationJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
CancelEntityReconciliationJobRequest request =
CancelEntityReconciliationJobRequest.newBuilder()
.setName(
EntityReconciliationJobName.of(
"[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString())
.build();
enterpriseKnowledgeGraphServiceClient.cancelEntityReconciliationJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CancelEntityReconciliationJobRequest,com.google.protobuf.Empty> cancelEntityReconciliationJobCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
CancelEntityReconciliationJobRequest request =
CancelEntityReconciliationJobRequest.newBuilder()
.setName(
EntityReconciliationJobName.of(
"[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
enterpriseKnowledgeGraphServiceClient
.cancelEntityReconciliationJobCallable()
.futureCall(request);
// Do something.
future.get();
}
public final void deleteEntityReconciliationJob(EntityReconciliationJobName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
EntityReconciliationJobName name =
EntityReconciliationJobName.of("[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]");
enterpriseKnowledgeGraphServiceClient.deleteEntityReconciliationJob(name);
}
name - Required. The name of the EntityReconciliationJob resource. Format:
`projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteEntityReconciliationJob(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String name =
EntityReconciliationJobName.of("[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString();
enterpriseKnowledgeGraphServiceClient.deleteEntityReconciliationJob(name);
}
name - Required. The name of the EntityReconciliationJob resource. Format:
`projects/{project}/locations/{location}/entityReconciliationJobs/{entity_reconciliation_job}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteEntityReconciliationJob(DeleteEntityReconciliationJobRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
DeleteEntityReconciliationJobRequest request =
DeleteEntityReconciliationJobRequest.newBuilder()
.setName(
EntityReconciliationJobName.of(
"[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString())
.build();
enterpriseKnowledgeGraphServiceClient.deleteEntityReconciliationJob(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteEntityReconciliationJobRequest,com.google.protobuf.Empty> deleteEntityReconciliationJobCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
DeleteEntityReconciliationJobRequest request =
DeleteEntityReconciliationJobRequest.newBuilder()
.setName(
EntityReconciliationJobName.of(
"[PROJECT]", "[LOCATION]", "[ENTITY_RECONCILIATION_JOB]")
.toString())
.build();
ApiFuture<Empty> future =
enterpriseKnowledgeGraphServiceClient
.deleteEntityReconciliationJobCallable()
.futureCall(request);
// Do something.
future.get();
}
public final LookupResponse lookup(LocationName parent, List<String> ids)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
List<String> ids = new ArrayList<>();
LookupResponse response = enterpriseKnowledgeGraphServiceClient.lookup(parent, ids);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`ids - Required. The list of entity ids to be used for lookup.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LookupResponse lookup(String parent, List<String> ids)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
List<String> ids = new ArrayList<>();
LookupResponse response = enterpriseKnowledgeGraphServiceClient.lookup(parent, ids);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`ids - Required. The list of entity ids to be used for lookup.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LookupResponse lookup(LookupRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LookupRequest request =
LookupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.addAllIds(new ArrayList<String>())
.addAllLanguages(new ArrayList<String>())
.build();
LookupResponse response = enterpriseKnowledgeGraphServiceClient.lookup(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<LookupRequest,LookupResponse> lookupCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LookupRequest request =
LookupRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.addAllIds(new ArrayList<String>())
.addAllLanguages(new ArrayList<String>())
.build();
ApiFuture<LookupResponse> future =
enterpriseKnowledgeGraphServiceClient.lookupCallable().futureCall(request);
// Do something.
LookupResponse response = future.get();
}
public final SearchResponse search(LocationName parent, String query)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String query = "query107944136";
SearchResponse response = enterpriseKnowledgeGraphServiceClient.search(parent, query);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`query - Required. The literal query string for search.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SearchResponse search(String parent, String query)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
String query = "query107944136";
SearchResponse response = enterpriseKnowledgeGraphServiceClient.search(parent, query);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`query - Required. The literal query string for search.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SearchResponse search(SearchRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
SearchRequest request =
SearchRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setQuery("query107944136")
.addAllLanguages(new ArrayList<String>())
.addAllTypes(new ArrayList<String>())
.setLimit(Int32Value.newBuilder().build())
.build();
SearchResponse response = enterpriseKnowledgeGraphServiceClient.search(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchRequest,SearchResponse> searchCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
SearchRequest request =
SearchRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setQuery("query107944136")
.addAllLanguages(new ArrayList<String>())
.addAllTypes(new ArrayList<String>())
.setLimit(Int32Value.newBuilder().build())
.build();
ApiFuture<SearchResponse> future =
enterpriseKnowledgeGraphServiceClient.searchCallable().futureCall(request);
// Do something.
SearchResponse response = future.get();
}
public final LookupPublicKgResponse lookupPublicKg(LocationName parent, List<String> ids)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
List<String> ids = new ArrayList<>();
LookupPublicKgResponse response =
enterpriseKnowledgeGraphServiceClient.lookupPublicKg(parent, ids);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`ids - Required. The list of entity ids to be used for lookup.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LookupPublicKgResponse lookupPublicKg(String parent, List<String> ids)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
List<String> ids = new ArrayList<>();
LookupPublicKgResponse response =
enterpriseKnowledgeGraphServiceClient.lookupPublicKg(parent, ids);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`ids - Required. The list of entity ids to be used for lookup.com.google.api.gax.rpc.ApiException - if the remote call failspublic final LookupPublicKgResponse lookupPublicKg(LookupPublicKgRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LookupPublicKgRequest request =
LookupPublicKgRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.addAllIds(new ArrayList<String>())
.addAllLanguages(new ArrayList<String>())
.build();
LookupPublicKgResponse response =
enterpriseKnowledgeGraphServiceClient.lookupPublicKg(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<LookupPublicKgRequest,LookupPublicKgResponse> lookupPublicKgCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LookupPublicKgRequest request =
LookupPublicKgRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.addAllIds(new ArrayList<String>())
.addAllLanguages(new ArrayList<String>())
.build();
ApiFuture<LookupPublicKgResponse> future =
enterpriseKnowledgeGraphServiceClient.lookupPublicKgCallable().futureCall(request);
// Do something.
LookupPublicKgResponse response = future.get();
}
public final SearchPublicKgResponse searchPublicKg(LocationName parent, String query)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
String query = "query107944136";
SearchPublicKgResponse response =
enterpriseKnowledgeGraphServiceClient.searchPublicKg(parent, query);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`query - Required. The literal query string for search.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SearchPublicKgResponse searchPublicKg(String parent, String query)
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
String query = "query107944136";
SearchPublicKgResponse response =
enterpriseKnowledgeGraphServiceClient.searchPublicKg(parent, query);
}
parent - Required. The name of the Entity's parent resource. Format:
`projects/{project}/locations/{location}`query - Required. The literal query string for search.com.google.api.gax.rpc.ApiException - if the remote call failspublic final SearchPublicKgResponse searchPublicKg(SearchPublicKgRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
SearchPublicKgRequest request =
SearchPublicKgRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setQuery("query107944136")
.addAllLanguages(new ArrayList<String>())
.addAllTypes(new ArrayList<String>())
.setLimit(Int32Value.newBuilder().build())
.build();
SearchPublicKgResponse response =
enterpriseKnowledgeGraphServiceClient.searchPublicKg(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchPublicKgRequest,SearchPublicKgResponse> searchPublicKgCallable()
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 (EnterpriseKnowledgeGraphServiceClient enterpriseKnowledgeGraphServiceClient =
EnterpriseKnowledgeGraphServiceClient.create()) {
SearchPublicKgRequest request =
SearchPublicKgRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setQuery("query107944136")
.addAllLanguages(new ArrayList<String>())
.addAllTypes(new ArrayList<String>())
.setLimit(Int32Value.newBuilder().build())
.build();
ApiFuture<SearchPublicKgResponse> future =
enterpriseKnowledgeGraphServiceClient.searchPublicKgCallable().futureCall(request);
// Do something.
SearchPublicKgResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.