Skip to content

Commit 9e4ace2

Browse files
feat: [java-enterpriseknowledgegraph] publish Google Cloud's Cloud Knowledge Graph (CKG) API (#8758)
* feat: publish Google Cloud's Cloud Knowledge Graph (CKG) API CKG lookup and search APIs enable customers to search, link and federate their own knowledge with Google’s. PiperOrigin-RevId: 487280461 Source-Link: googleapis/googleapis@f19c628 Source-Link: https://github.com/googleapis/googleapis-gen/commit/03934bf2f9ab806e73c8c7595cac9fe0597ba996 Copy-Tag: eyJwIjoiamF2YS1lbnRlcnByaXNla25vd2xlZGdlZ3JhcGgvLk93bEJvdC55YW1sIiwiaCI6IjAzOTM0YmYyZjlhYjgwNmU3M2M4Yzc1OTVjYWM5ZmUwNTk3YmE5OTYifQ== * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 800cb54 commit 9e4ace2

31 files changed

Lines changed: 15363 additions & 128 deletions

File tree

java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClient.java

Lines changed: 522 additions & 0 deletions
Large diffs are not rendered by default.

java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceSettings.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,28 @@ public class EnterpriseKnowledgeGraphServiceSettings
117117
.deleteEntityReconciliationJobSettings();
118118
}
119119

120+
/** Returns the object with the settings used for calls to lookup. */
121+
public UnaryCallSettings<LookupRequest, LookupResponse> lookupSettings() {
122+
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()).lookupSettings();
123+
}
124+
125+
/** Returns the object with the settings used for calls to search. */
126+
public UnaryCallSettings<SearchRequest, SearchResponse> searchSettings() {
127+
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()).searchSettings();
128+
}
129+
130+
/** Returns the object with the settings used for calls to lookupPublicKg. */
131+
public UnaryCallSettings<LookupPublicKgRequest, LookupPublicKgResponse> lookupPublicKgSettings() {
132+
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings())
133+
.lookupPublicKgSettings();
134+
}
135+
136+
/** Returns the object with the settings used for calls to searchPublicKg. */
137+
public UnaryCallSettings<SearchPublicKgRequest, SearchPublicKgResponse> searchPublicKgSettings() {
138+
return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings())
139+
.searchPublicKgSettings();
140+
}
141+
120142
public static final EnterpriseKnowledgeGraphServiceSettings create(
121143
EnterpriseKnowledgeGraphServiceStubSettings stub) throws IOException {
122144
return new EnterpriseKnowledgeGraphServiceSettings.Builder(stub.toBuilder()).build();
@@ -266,6 +288,28 @@ public Builder applyToAllUnaryMethods(
266288
return getStubSettingsBuilder().deleteEntityReconciliationJobSettings();
267289
}
268290

291+
/** Returns the builder for the settings used for calls to lookup. */
292+
public UnaryCallSettings.Builder<LookupRequest, LookupResponse> lookupSettings() {
293+
return getStubSettingsBuilder().lookupSettings();
294+
}
295+
296+
/** Returns the builder for the settings used for calls to search. */
297+
public UnaryCallSettings.Builder<SearchRequest, SearchResponse> searchSettings() {
298+
return getStubSettingsBuilder().searchSettings();
299+
}
300+
301+
/** Returns the builder for the settings used for calls to lookupPublicKg. */
302+
public UnaryCallSettings.Builder<LookupPublicKgRequest, LookupPublicKgResponse>
303+
lookupPublicKgSettings() {
304+
return getStubSettingsBuilder().lookupPublicKgSettings();
305+
}
306+
307+
/** Returns the builder for the settings used for calls to searchPublicKg. */
308+
public UnaryCallSettings.Builder<SearchPublicKgRequest, SearchPublicKgResponse>
309+
searchPublicKgSettings() {
310+
return getStubSettingsBuilder().searchPublicKgSettings();
311+
}
312+
269313
@Override
270314
public EnterpriseKnowledgeGraphServiceSettings build() throws IOException {
271315
return new EnterpriseKnowledgeGraphServiceSettings(this);

java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/gapic_metadata.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@
2424
},
2525
"ListEntityReconciliationJobs": {
2626
"methods": ["listEntityReconciliationJobs", "listEntityReconciliationJobs", "listEntityReconciliationJobs", "listEntityReconciliationJobsPagedCallable", "listEntityReconciliationJobsCallable"]
27+
},
28+
"Lookup": {
29+
"methods": ["lookup", "lookup", "lookup", "lookupCallable"]
30+
},
31+
"LookupPublicKg": {
32+
"methods": ["lookupPublicKg", "lookupPublicKg", "lookupPublicKg", "lookupPublicKgCallable"]
33+
},
34+
"Search": {
35+
"methods": ["search", "search", "search", "searchCallable"]
36+
},
37+
"SearchPublicKg": {
38+
"methods": ["searchPublicKg", "searchPublicKg", "searchPublicKg", "searchPublicKgCallable"]
2739
}
2840
}
2941
}

java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStub.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
import com.google.cloud.enterpriseknowledgegraph.v1.GetEntityReconciliationJobRequest;
2828
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsRequest;
2929
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsResponse;
30+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest;
31+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse;
32+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest;
33+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse;
34+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest;
35+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse;
36+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest;
37+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse;
3038
import com.google.protobuf.Empty;
3139
import javax.annotation.Generated;
3240

@@ -76,6 +84,22 @@ public abstract class EnterpriseKnowledgeGraphServiceStub implements BackgroundR
7684
"Not implemented: deleteEntityReconciliationJobCallable()");
7785
}
7886

87+
public UnaryCallable<LookupRequest, LookupResponse> lookupCallable() {
88+
throw new UnsupportedOperationException("Not implemented: lookupCallable()");
89+
}
90+
91+
public UnaryCallable<SearchRequest, SearchResponse> searchCallable() {
92+
throw new UnsupportedOperationException("Not implemented: searchCallable()");
93+
}
94+
95+
public UnaryCallable<LookupPublicKgRequest, LookupPublicKgResponse> lookupPublicKgCallable() {
96+
throw new UnsupportedOperationException("Not implemented: lookupPublicKgCallable()");
97+
}
98+
99+
public UnaryCallable<SearchPublicKgRequest, SearchPublicKgResponse> searchPublicKgCallable() {
100+
throw new UnsupportedOperationException("Not implemented: searchPublicKgCallable()");
101+
}
102+
79103
@Override
80104
public abstract void close();
81105
}

java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStubSettings.java

Lines changed: 107 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@
5050
import com.google.cloud.enterpriseknowledgegraph.v1.GetEntityReconciliationJobRequest;
5151
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsRequest;
5252
import com.google.cloud.enterpriseknowledgegraph.v1.ListEntityReconciliationJobsResponse;
53+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest;
54+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse;
55+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest;
56+
import com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse;
57+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest;
58+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse;
59+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest;
60+
import com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse;
5361
import com.google.common.collect.ImmutableList;
5462
import com.google.common.collect.ImmutableMap;
5563
import com.google.common.collect.ImmutableSet;
@@ -120,6 +128,12 @@ public class EnterpriseKnowledgeGraphServiceStubSettings
120128
cancelEntityReconciliationJobSettings;
121129
private final UnaryCallSettings<DeleteEntityReconciliationJobRequest, Empty>
122130
deleteEntityReconciliationJobSettings;
131+
private final UnaryCallSettings<LookupRequest, LookupResponse> lookupSettings;
132+
private final UnaryCallSettings<SearchRequest, SearchResponse> searchSettings;
133+
private final UnaryCallSettings<LookupPublicKgRequest, LookupPublicKgResponse>
134+
lookupPublicKgSettings;
135+
private final UnaryCallSettings<SearchPublicKgRequest, SearchPublicKgResponse>
136+
searchPublicKgSettings;
123137

124138
private static final PagedListDescriptor<
125139
ListEntityReconciliationJobsRequest,
@@ -235,6 +249,26 @@ public ApiFuture<ListEntityReconciliationJobsPagedResponse> getFuturePagedRespon
235249
return deleteEntityReconciliationJobSettings;
236250
}
237251

252+
/** Returns the object with the settings used for calls to lookup. */
253+
public UnaryCallSettings<LookupRequest, LookupResponse> lookupSettings() {
254+
return lookupSettings;
255+
}
256+
257+
/** Returns the object with the settings used for calls to search. */
258+
public UnaryCallSettings<SearchRequest, SearchResponse> searchSettings() {
259+
return searchSettings;
260+
}
261+
262+
/** Returns the object with the settings used for calls to lookupPublicKg. */
263+
public UnaryCallSettings<LookupPublicKgRequest, LookupPublicKgResponse> lookupPublicKgSettings() {
264+
return lookupPublicKgSettings;
265+
}
266+
267+
/** Returns the object with the settings used for calls to searchPublicKg. */
268+
public UnaryCallSettings<SearchPublicKgRequest, SearchPublicKgResponse> searchPublicKgSettings() {
269+
return searchPublicKgSettings;
270+
}
271+
238272
public EnterpriseKnowledgeGraphServiceStub createStub() throws IOException {
239273
if (getTransportChannelProvider()
240274
.getTransportName()
@@ -354,6 +388,10 @@ protected EnterpriseKnowledgeGraphServiceStubSettings(Builder settingsBuilder)
354388
settingsBuilder.cancelEntityReconciliationJobSettings().build();
355389
deleteEntityReconciliationJobSettings =
356390
settingsBuilder.deleteEntityReconciliationJobSettings().build();
391+
lookupSettings = settingsBuilder.lookupSettings().build();
392+
searchSettings = settingsBuilder.searchSettings().build();
393+
lookupPublicKgSettings = settingsBuilder.lookupPublicKgSettings().build();
394+
searchPublicKgSettings = settingsBuilder.searchPublicKgSettings().build();
357395
}
358396

359397
/** Builder for EnterpriseKnowledgeGraphServiceStubSettings. */
@@ -375,6 +413,12 @@ public static class Builder
375413
cancelEntityReconciliationJobSettings;
376414
private final UnaryCallSettings.Builder<DeleteEntityReconciliationJobRequest, Empty>
377415
deleteEntityReconciliationJobSettings;
416+
private final UnaryCallSettings.Builder<LookupRequest, LookupResponse> lookupSettings;
417+
private final UnaryCallSettings.Builder<SearchRequest, SearchResponse> searchSettings;
418+
private final UnaryCallSettings.Builder<LookupPublicKgRequest, LookupPublicKgResponse>
419+
lookupPublicKgSettings;
420+
private final UnaryCallSettings.Builder<SearchPublicKgRequest, SearchPublicKgResponse>
421+
searchPublicKgSettings;
378422
private static final ImmutableMap<String, ImmutableSet<StatusCode.Code>>
379423
RETRYABLE_CODE_DEFINITIONS;
380424

@@ -386,6 +430,7 @@ public static class Builder
386430
definitions.put(
387431
"retry_policy_0_codes",
388432
ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList(StatusCode.Code.UNAVAILABLE)));
433+
definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.<StatusCode.Code>newArrayList()));
389434
RETRYABLE_CODE_DEFINITIONS = definitions.build();
390435
}
391436

@@ -413,6 +458,8 @@ public static class Builder
413458
.setTotalTimeout(Duration.ofMillis(60000L))
414459
.build();
415460
definitions.put("retry_policy_0_params", settings);
461+
settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
462+
definitions.put("no_retry_params", settings);
416463
RETRY_PARAM_DEFINITIONS = definitions.build();
417464
}
418465

@@ -429,14 +476,22 @@ protected Builder(ClientContext clientContext) {
429476
PagedCallSettings.newBuilder(LIST_ENTITY_RECONCILIATION_JOBS_PAGE_STR_FACT);
430477
cancelEntityReconciliationJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
431478
deleteEntityReconciliationJobSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
479+
lookupSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
480+
searchSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
481+
lookupPublicKgSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
482+
searchPublicKgSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
432483

433484
unaryMethodSettingsBuilders =
434485
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
435486
createEntityReconciliationJobSettings,
436487
getEntityReconciliationJobSettings,
437488
listEntityReconciliationJobsSettings,
438489
cancelEntityReconciliationJobSettings,
439-
deleteEntityReconciliationJobSettings);
490+
deleteEntityReconciliationJobSettings,
491+
lookupSettings,
492+
searchSettings,
493+
lookupPublicKgSettings,
494+
searchPublicKgSettings);
440495
initDefaults(this);
441496
}
442497

@@ -452,14 +507,22 @@ protected Builder(EnterpriseKnowledgeGraphServiceStubSettings settings) {
452507
settings.cancelEntityReconciliationJobSettings.toBuilder();
453508
deleteEntityReconciliationJobSettings =
454509
settings.deleteEntityReconciliationJobSettings.toBuilder();
510+
lookupSettings = settings.lookupSettings.toBuilder();
511+
searchSettings = settings.searchSettings.toBuilder();
512+
lookupPublicKgSettings = settings.lookupPublicKgSettings.toBuilder();
513+
searchPublicKgSettings = settings.searchPublicKgSettings.toBuilder();
455514

456515
unaryMethodSettingsBuilders =
457516
ImmutableList.<UnaryCallSettings.Builder<?, ?>>of(
458517
createEntityReconciliationJobSettings,
459518
getEntityReconciliationJobSettings,
460519
listEntityReconciliationJobsSettings,
461520
cancelEntityReconciliationJobSettings,
462-
deleteEntityReconciliationJobSettings);
521+
deleteEntityReconciliationJobSettings,
522+
lookupSettings,
523+
searchSettings,
524+
lookupPublicKgSettings,
525+
searchPublicKgSettings);
463526
}
464527

465528
private static Builder createDefault() {
@@ -514,6 +577,26 @@ private static Builder initDefaults(Builder builder) {
514577
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
515578
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
516579

580+
builder
581+
.lookupSettings()
582+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
583+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
584+
585+
builder
586+
.searchSettings()
587+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
588+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
589+
590+
builder
591+
.lookupPublicKgSettings()
592+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
593+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
594+
595+
builder
596+
.searchPublicKgSettings()
597+
.setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
598+
.setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
599+
517600
return builder;
518601
}
519602

@@ -565,6 +648,28 @@ public Builder applyToAllUnaryMethods(
565648
return deleteEntityReconciliationJobSettings;
566649
}
567650

651+
/** Returns the builder for the settings used for calls to lookup. */
652+
public UnaryCallSettings.Builder<LookupRequest, LookupResponse> lookupSettings() {
653+
return lookupSettings;
654+
}
655+
656+
/** Returns the builder for the settings used for calls to search. */
657+
public UnaryCallSettings.Builder<SearchRequest, SearchResponse> searchSettings() {
658+
return searchSettings;
659+
}
660+
661+
/** Returns the builder for the settings used for calls to lookupPublicKg. */
662+
public UnaryCallSettings.Builder<LookupPublicKgRequest, LookupPublicKgResponse>
663+
lookupPublicKgSettings() {
664+
return lookupPublicKgSettings;
665+
}
666+
667+
/** Returns the builder for the settings used for calls to searchPublicKg. */
668+
public UnaryCallSettings.Builder<SearchPublicKgRequest, SearchPublicKgResponse>
669+
searchPublicKgSettings() {
670+
return searchPublicKgSettings;
671+
}
672+
568673
@Override
569674
public EnterpriseKnowledgeGraphServiceStubSettings build() throws IOException {
570675
return new EnterpriseKnowledgeGraphServiceStubSettings(this);

0 commit comments

Comments
 (0)