Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [java-enterpriseknowledgegraph] publish Google Cloud's Cloud Knowledge Graph (CKG) API #8758

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,28 @@ public class EnterpriseKnowledgeGraphServiceSettings
.deleteEntityReconciliationJobSettings();
}

/** Returns the object with the settings used for calls to lookup. */
public UnaryCallSettings<LookupRequest, LookupResponse> lookupSettings() {
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()).lookupSettings();
}

/** Returns the object with the settings used for calls to search. */
public UnaryCallSettings<SearchRequest, SearchResponse> searchSettings() {
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()).searchSettings();
}

/** Returns the object with the settings used for calls to lookupPublicKg. */
public UnaryCallSettings<LookupPublicKgRequest, LookupPublicKgResponse> lookupPublicKgSettings() {
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings())
.lookupPublicKgSettings();
}

/** Returns the object with the settings used for calls to searchPublicKg. */
public UnaryCallSettings<SearchPublicKgRequest, SearchPublicKgResponse> searchPublicKgSettings() {
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings())
.searchPublicKgSettings();
}

public static final EnterpriseKnowledgeGraphServiceSettings create(
EnterpriseKnowledgeGraphServiceStubSettings stub) throws IOException {
return new EnterpriseKnowledgeGraphServiceSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -266,6 +288,28 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().deleteEntityReconciliationJobSettings();
}

/** Returns the builder for the settings used for calls to lookup. */
public UnaryCallSettings.Builder<LookupRequest, LookupResponse> lookupSettings() {
return getStubSettingsBuilder().lookupSettings();
}

/** Returns the builder for the settings used for calls to search. */
public UnaryCallSettings.Builder<SearchRequest, SearchResponse> searchSettings() {
return getStubSettingsBuilder().searchSettings();
}

/** Returns the builder for the settings used for calls to lookupPublicKg. */
public UnaryCallSettings.Builder<LookupPublicKgRequest, LookupPublicKgResponse>
lookupPublicKgSettings() {
return getStubSettingsBuilder().lookupPublicKgSettings();
}

/** Returns the builder for the settings used for calls to searchPublicKg. */
public UnaryCallSettings.Builder<SearchPublicKgRequest, SearchPublicKgResponse>
searchPublicKgSettings() {
return getStubSettingsBuilder().searchPublicKgSettings();
}

@Override
public EnterpriseKnowledgeGraphServiceSettings build() throws IOException {
return new EnterpriseKnowledgeGraphServiceSettings(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
},
"ListEntityReconciliationJobs": {
"methods": ["listEntityReconciliationJobs", "listEntityReconciliationJobs", "listEntityReconciliationJobs", "listEntityReconciliationJobsPagedCallable", "listEntityReconciliationJobsCallable"]
},
"Lookup": {
"methods": ["lookup", "lookup", "lookup", "lookupCallable"]
},
"LookupPublicKg": {
"methods": ["lookupPublicKg", "lookupPublicKg", "lookupPublicKg", "lookupPublicKgCallable"]
},
"Search": {
"methods": ["search", "search", "search", "searchCallable"]
},
"SearchPublicKg": {
"methods": ["searchPublicKg", "searchPublicKg", "searchPublicKg", "searchPublicKgCallable"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
import com.google.cloud.enterpriseknowledgegraph.v1.GetEntityReconciliationJobRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse;
import com.google.protobuf.Empty;
import javax.annotation.Generated;

Expand Down Expand Up @@ -76,6 +84,22 @@ public abstract class EnterpriseKnowledgeGraphServiceStub implements BackgroundR
"Not implemented: deleteEntityReconciliationJobCallable()");
}

public UnaryCallable<LookupRequest, LookupResponse> lookupCallable() {
throw new UnsupportedOperationException("Not implemented: lookupCallable()");
}

public UnaryCallable<SearchRequest, SearchResponse> searchCallable() {
throw new UnsupportedOperationException("Not implemented: searchCallable()");
}

public UnaryCallable<LookupPublicKgRequest, LookupPublicKgResponse> lookupPublicKgCallable() {
throw new UnsupportedOperationException("Not implemented: lookupPublicKgCallable()");
}

public UnaryCallable<SearchPublicKgRequest, SearchPublicKgResponse> searchPublicKgCallable() {
throw new UnsupportedOperationException("Not implemented: searchPublicKgCallable()");
}

@Override
public abstract void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@
import com.google.cloud.enterpriseknowledgegraph.v1.GetEntityReconciliationJobRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest;
import com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
Expand Down Expand Up @@ -120,6 +128,12 @@ public class EnterpriseKnowledgeGraphServiceStubSettings
cancelEntityReconciliationJobSettings;
private final UnaryCallSettings<DeleteEntityReconciliationJobRequest, Empty>
deleteEntityReconciliationJobSettings;
private final UnaryCallSettings<LookupRequest, LookupResponse> lookupSettings;
private final UnaryCallSettings<SearchRequest, SearchResponse> searchSettings;
private final UnaryCallSettings<LookupPublicKgRequest, LookupPublicKgResponse>
lookupPublicKgSettings;
private final UnaryCallSettings<SearchPublicKgRequest, SearchPublicKgResponse>
searchPublicKgSettings;

private static final PagedListDescriptor<
ListEntityReconciliationJobsRequest,
Expand Down Expand Up @@ -235,6 +249,26 @@ public ApiFuture<ListEntityReconciliationJobsPagedResponse> getFuturePagedRespon
return deleteEntityReconciliationJobSettings;
}

/** Returns the object with the settings used for calls to lookup. */
public UnaryCallSettings<LookupRequest, LookupResponse> lookupSettings() {
return lookupSettings;
}

/** Returns the object with the settings used for calls to search. */
public UnaryCallSettings<SearchRequest, SearchResponse> searchSettings() {
return searchSettings;
}

/** Returns the object with the settings used for calls to lookupPublicKg. */
public UnaryCallSettings<LookupPublicKgRequest, LookupPublicKgResponse> lookupPublicKgSettings() {
return lookupPublicKgSettings;
}

/** Returns the object with the settings used for calls to searchPublicKg. */
public UnaryCallSettings<SearchPublicKgRequest, SearchPublicKgResponse> searchPublicKgSettings() {
return searchPublicKgSettings;
}

public EnterpriseKnowledgeGraphServiceStub createStub() throws IOException {
if (getTransportChannelProvider()
.getTransportName()
Expand Down Expand Up @@ -354,6 +388,10 @@ protected EnterpriseKnowledgeGraphServiceStubSettings(Builder settingsBuilder)
settingsBuilder.cancelEntityReconciliationJobSettings().build();
deleteEntityReconciliationJobSettings =
settingsBuilder.deleteEntityReconciliationJobSettings().build();
lookupSettings = settingsBuilder.lookupSettings().build();
searchSettings = settingsBuilder.searchSettings().build();
lookupPublicKgSettings = settingsBuilder.lookupPublicKgSettings().build();
searchPublicKgSettings = settingsBuilder.searchPublicKgSettings().build();
}

/** Builder for EnterpriseKnowledgeGraphServiceStubSettings. */
Expand All @@ -375,6 +413,12 @@ public static class Builder
cancelEntityReconciliationJobSettings;
private final UnaryCallSettings.Builder<DeleteEntityReconciliationJobRequest, Empty>
deleteEntityReconciliationJobSettings;
private final UnaryCallSettings.Builder<LookupRequest, LookupResponse> lookupSettings;
private final UnaryCallSettings.Builder<SearchRequest, SearchResponse> searchSettings;
private final UnaryCallSettings.Builder<LookupPublicKgRequest, LookupPublicKgResponse>
lookupPublicKgSettings;
private final UnaryCallSettings.Builder<SearchPublicKgRequest, SearchPublicKgResponse>
searchPublicKgSettings;
private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
RETRYABLE_CODE_DEFINITIONS;

Expand All @@ -386,6 +430,7 @@ public static class Builder
definitions.put(
"retry_policy_0_codes",
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
RETRYABLE_CODE_DEFINITIONS = definitions.build();
}

Expand Down Expand Up @@ -413,6 +458,8 @@ public static class Builder
.setTotalTimeout(Duration.ofMillis(60000L))
.build();
definitions.put("retry_policy_0_params", settings);
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
definitions.put("no_retry_params", settings);
RETRY_PARAM_DEFINITIONS = definitions.build();
}

Expand All @@ -429,14 +476,22 @@ protected Builder(ClientContext clientContext) {
PagedCallSettings.newBuilder(LIST_ENTITY_RECONCILIATION_JOBS_PAGE_STR_FACT);
cancelEntityReconciliationJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
deleteEntityReconciliationJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
lookupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
searchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
lookupPublicKgSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
searchPublicKgSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
createEntityReconciliationJobSettings,
getEntityReconciliationJobSettings,
listEntityReconciliationJobsSettings,
cancelEntityReconciliationJobSettings,
deleteEntityReconciliationJobSettings);
deleteEntityReconciliationJobSettings,
lookupSettings,
searchSettings,
lookupPublicKgSettings,
searchPublicKgSettings);
initDefaults(this);
}

Expand All @@ -452,14 +507,22 @@ protected Builder(EnterpriseKnowledgeGraphServiceStubSettings settings) {
settings.cancelEntityReconciliationJobSettings.toBuilder();
deleteEntityReconciliationJobSettings =
settings.deleteEntityReconciliationJobSettings.toBuilder();
lookupSettings = settings.lookupSettings.toBuilder();
searchSettings = settings.searchSettings.toBuilder();
lookupPublicKgSettings = settings.lookupPublicKgSettings.toBuilder();
searchPublicKgSettings = settings.searchPublicKgSettings.toBuilder();

unaryMethodSettingsBuilders =
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
createEntityReconciliationJobSettings,
getEntityReconciliationJobSettings,
listEntityReconciliationJobsSettings,
cancelEntityReconciliationJobSettings,
deleteEntityReconciliationJobSettings);
deleteEntityReconciliationJobSettings,
lookupSettings,
searchSettings,
lookupPublicKgSettings,
searchPublicKgSettings);
}

private static Builder createDefault() {
Expand Down Expand Up @@ -514,6 +577,26 @@ private static Builder initDefaults(Builder builder) {
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));

builder
.lookupSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.searchSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.lookupPublicKgSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

builder
.searchPublicKgSettings()
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));

return builder;
}

Expand Down Expand Up @@ -565,6 +648,28 @@ public Builder applyToAllUnaryMethods(
return deleteEntityReconciliationJobSettings;
}

/** Returns the builder for the settings used for calls to lookup. */
public UnaryCallSettings.Builder<LookupRequest, LookupResponse> lookupSettings() {
return lookupSettings;
}

/** Returns the builder for the settings used for calls to search. */
public UnaryCallSettings.Builder<SearchRequest, SearchResponse> searchSettings() {
return searchSettings;
}

/** Returns the builder for the settings used for calls to lookupPublicKg. */
public UnaryCallSettings.Builder<LookupPublicKgRequest, LookupPublicKgResponse>
lookupPublicKgSettings() {
return lookupPublicKgSettings;
}

/** Returns the builder for the settings used for calls to searchPublicKg. */
public UnaryCallSettings.Builder<SearchPublicKgRequest, SearchPublicKgResponse>
searchPublicKgSettings() {
return searchPublicKgSettings;
}

@Override
public EnterpriseKnowledgeGraphServiceStubSettings build() throws IOException {
return new EnterpriseKnowledgeGraphServiceStubSettings(this);
Expand Down
Loading