diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClient.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClient.java index fa4c4c661ee1..a63c8a5f2f27 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClient.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClient.java @@ -919,6 +919,528 @@ public final void deleteEntityReconciliationJob(DeleteEntityReconciliationJobReq return stub.deleteEntityReconciliationJobCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the Cloud KG entities with CKG ID(s). + * + *

Sample code: + * + *

{@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 ids = new ArrayList<>();
+   *   LookupResponse response = enterpriseKnowledgeGraphServiceClient.lookup(parent, ids);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param ids Required. The list of entity ids to be used for lookup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupResponse lookup(LocationName parent, List ids) { + LookupRequest request = + LookupRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .addAllIds(ids) + .build(); + return lookup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the Cloud KG entities with CKG ID(s). + * + *

Sample code: + * + *

{@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 ids = new ArrayList<>();
+   *   LookupResponse response = enterpriseKnowledgeGraphServiceClient.lookup(parent, ids);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param ids Required. The list of entity ids to be used for lookup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupResponse lookup(String parent, List ids) { + LookupRequest request = LookupRequest.newBuilder().setParent(parent).addAllIds(ids).build(); + return lookup(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the Cloud KG entities with CKG ID(s). + * + *

Sample code: + * + *

{@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())
+   *           .addAllLanguages(new ArrayList())
+   *           .build();
+   *   LookupResponse response = enterpriseKnowledgeGraphServiceClient.lookup(request);
+   * }
+   * }
+ * + * @param 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 + */ + public final LookupResponse lookup(LookupRequest request) { + return lookupCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the Cloud KG entities with CKG ID(s). + * + *

Sample code: + * + *

{@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())
+   *           .addAllLanguages(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       enterpriseKnowledgeGraphServiceClient.lookupCallable().futureCall(request);
+   *   // Do something.
+   *   LookupResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable lookupCallable() { + return stub.lookupCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the Cloud KG entities with entity name. + * + *

Sample code: + * + *

{@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);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param query Required. The literal query string for search. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchResponse search(LocationName parent, String query) { + SearchRequest request = + SearchRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return search(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the Cloud KG entities with entity name. + * + *

Sample code: + * + *

{@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);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param query Required. The literal query string for search. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchResponse search(String parent, String query) { + SearchRequest request = SearchRequest.newBuilder().setParent(parent).setQuery(query).build(); + return search(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the Cloud KG entities with entity name. + * + *

Sample code: + * + *

{@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())
+   *           .addAllTypes(new ArrayList())
+   *           .setLimit(Int32Value.newBuilder().build())
+   *           .build();
+   *   SearchResponse response = enterpriseKnowledgeGraphServiceClient.search(request);
+   * }
+   * }
+ * + * @param 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 + */ + public final SearchResponse search(SearchRequest request) { + return searchCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the Cloud KG entities with entity name. + * + *

Sample code: + * + *

{@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())
+   *           .addAllTypes(new ArrayList())
+   *           .setLimit(Int32Value.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       enterpriseKnowledgeGraphServiceClient.searchCallable().futureCall(request);
+   *   // Do something.
+   *   SearchResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable searchCallable() { + return stub.searchCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the public KG entities with public KG ID(s). + * + *

Sample code: + * + *

{@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 ids = new ArrayList<>();
+   *   LookupPublicKgResponse response =
+   *       enterpriseKnowledgeGraphServiceClient.lookupPublicKg(parent, ids);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param ids Required. The list of entity ids to be used for lookup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupPublicKgResponse lookupPublicKg(LocationName parent, List ids) { + LookupPublicKgRequest request = + LookupPublicKgRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .addAllIds(ids) + .build(); + return lookupPublicKg(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the public KG entities with public KG ID(s). + * + *

Sample code: + * + *

{@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 ids = new ArrayList<>();
+   *   LookupPublicKgResponse response =
+   *       enterpriseKnowledgeGraphServiceClient.lookupPublicKg(parent, ids);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param ids Required. The list of entity ids to be used for lookup. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final LookupPublicKgResponse lookupPublicKg(String parent, List ids) { + LookupPublicKgRequest request = + LookupPublicKgRequest.newBuilder().setParent(parent).addAllIds(ids).build(); + return lookupPublicKg(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the public KG entities with public KG ID(s). + * + *

Sample code: + * + *

{@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())
+   *           .addAllLanguages(new ArrayList())
+   *           .build();
+   *   LookupPublicKgResponse response =
+   *       enterpriseKnowledgeGraphServiceClient.lookupPublicKg(request);
+   * }
+   * }
+ * + * @param 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 + */ + public final LookupPublicKgResponse lookupPublicKg(LookupPublicKgRequest request) { + return lookupPublicKgCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Finds the public KG entities with public KG ID(s). + * + *

Sample code: + * + *

{@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())
+   *           .addAllLanguages(new ArrayList())
+   *           .build();
+   *   ApiFuture future =
+   *       enterpriseKnowledgeGraphServiceClient.lookupPublicKgCallable().futureCall(request);
+   *   // Do something.
+   *   LookupPublicKgResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + lookupPublicKgCallable() { + return stub.lookupPublicKgCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the public KG entities with entity name. + * + *

Sample code: + * + *

{@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);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param query Required. The literal query string for search. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchPublicKgResponse searchPublicKg(LocationName parent, String query) { + SearchPublicKgRequest request = + SearchPublicKgRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setQuery(query) + .build(); + return searchPublicKg(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the public KG entities with entity name. + * + *

Sample code: + * + *

{@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);
+   * }
+   * }
+ * + * @param parent Required. The name of the Entity's parent resource. Format: + * `projects/{project}/locations/{location}` + * @param query Required. The literal query string for search. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final SearchPublicKgResponse searchPublicKg(String parent, String query) { + SearchPublicKgRequest request = + SearchPublicKgRequest.newBuilder().setParent(parent).setQuery(query).build(); + return searchPublicKg(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the public KG entities with entity name. + * + *

Sample code: + * + *

{@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())
+   *           .addAllTypes(new ArrayList())
+   *           .setLimit(Int32Value.newBuilder().build())
+   *           .build();
+   *   SearchPublicKgResponse response =
+   *       enterpriseKnowledgeGraphServiceClient.searchPublicKg(request);
+   * }
+   * }
+ * + * @param 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 + */ + public final SearchPublicKgResponse searchPublicKg(SearchPublicKgRequest request) { + return searchPublicKgCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Searches the public KG entities with entity name. + * + *

Sample code: + * + *

{@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())
+   *           .addAllTypes(new ArrayList())
+   *           .setLimit(Int32Value.newBuilder().build())
+   *           .build();
+   *   ApiFuture future =
+   *       enterpriseKnowledgeGraphServiceClient.searchPublicKgCallable().futureCall(request);
+   *   // Do something.
+   *   SearchPublicKgResponse response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + searchPublicKgCallable() { + return stub.searchPublicKgCallable(); + } + @Override public final void close() { stub.close(); diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceSettings.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceSettings.java index 4757a56cd8ba..a67768e59fb8 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceSettings.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceSettings.java @@ -117,6 +117,28 @@ public class EnterpriseKnowledgeGraphServiceSettings .deleteEntityReconciliationJobSettings(); } + /** Returns the object with the settings used for calls to lookup. */ + public UnaryCallSettings lookupSettings() { + return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()).lookupSettings(); + } + + /** Returns the object with the settings used for calls to search. */ + public UnaryCallSettings searchSettings() { + return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()).searchSettings(); + } + + /** Returns the object with the settings used for calls to lookupPublicKg. */ + public UnaryCallSettings lookupPublicKgSettings() { + return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()) + .lookupPublicKgSettings(); + } + + /** Returns the object with the settings used for calls to searchPublicKg. */ + public UnaryCallSettings searchPublicKgSettings() { + return ((EnterpriseKnowledgeGraphServiceStubSettings) getStubSettings()) + .searchPublicKgSettings(); + } + public static final EnterpriseKnowledgeGraphServiceSettings create( EnterpriseKnowledgeGraphServiceStubSettings stub) throws IOException { return new EnterpriseKnowledgeGraphServiceSettings.Builder(stub.toBuilder()).build(); @@ -266,6 +288,28 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().deleteEntityReconciliationJobSettings(); } + /** Returns the builder for the settings used for calls to lookup. */ + public UnaryCallSettings.Builder lookupSettings() { + return getStubSettingsBuilder().lookupSettings(); + } + + /** Returns the builder for the settings used for calls to search. */ + public UnaryCallSettings.Builder searchSettings() { + return getStubSettingsBuilder().searchSettings(); + } + + /** Returns the builder for the settings used for calls to lookupPublicKg. */ + public UnaryCallSettings.Builder + lookupPublicKgSettings() { + return getStubSettingsBuilder().lookupPublicKgSettings(); + } + + /** Returns the builder for the settings used for calls to searchPublicKg. */ + public UnaryCallSettings.Builder + searchPublicKgSettings() { + return getStubSettingsBuilder().searchPublicKgSettings(); + } + @Override public EnterpriseKnowledgeGraphServiceSettings build() throws IOException { return new EnterpriseKnowledgeGraphServiceSettings(this); diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/gapic_metadata.json b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/gapic_metadata.json index 904cfd605df1..07231c453995 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/gapic_metadata.json +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/gapic_metadata.json @@ -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"] } } } diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStub.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStub.java index 64123ccd3851..9447f28d39f9 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStub.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStub.java @@ -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; @@ -76,6 +84,22 @@ public abstract class EnterpriseKnowledgeGraphServiceStub implements BackgroundR "Not implemented: deleteEntityReconciliationJobCallable()"); } + public UnaryCallable lookupCallable() { + throw new UnsupportedOperationException("Not implemented: lookupCallable()"); + } + + public UnaryCallable searchCallable() { + throw new UnsupportedOperationException("Not implemented: searchCallable()"); + } + + public UnaryCallable lookupPublicKgCallable() { + throw new UnsupportedOperationException("Not implemented: lookupPublicKgCallable()"); + } + + public UnaryCallable searchPublicKgCallable() { + throw new UnsupportedOperationException("Not implemented: searchPublicKgCallable()"); + } + @Override public abstract void close(); } diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStubSettings.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStubSettings.java index b612962ae44b..e32ccf4f6a34 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStubSettings.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/EnterpriseKnowledgeGraphServiceStubSettings.java @@ -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; @@ -120,6 +128,12 @@ public class EnterpriseKnowledgeGraphServiceStubSettings cancelEntityReconciliationJobSettings; private final UnaryCallSettings deleteEntityReconciliationJobSettings; + private final UnaryCallSettings lookupSettings; + private final UnaryCallSettings searchSettings; + private final UnaryCallSettings + lookupPublicKgSettings; + private final UnaryCallSettings + searchPublicKgSettings; private static final PagedListDescriptor< ListEntityReconciliationJobsRequest, @@ -235,6 +249,26 @@ public ApiFuture getFuturePagedRespon return deleteEntityReconciliationJobSettings; } + /** Returns the object with the settings used for calls to lookup. */ + public UnaryCallSettings lookupSettings() { + return lookupSettings; + } + + /** Returns the object with the settings used for calls to search. */ + public UnaryCallSettings searchSettings() { + return searchSettings; + } + + /** Returns the object with the settings used for calls to lookupPublicKg. */ + public UnaryCallSettings lookupPublicKgSettings() { + return lookupPublicKgSettings; + } + + /** Returns the object with the settings used for calls to searchPublicKg. */ + public UnaryCallSettings searchPublicKgSettings() { + return searchPublicKgSettings; + } + public EnterpriseKnowledgeGraphServiceStub createStub() throws IOException { if (getTransportChannelProvider() .getTransportName() @@ -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. */ @@ -375,6 +413,12 @@ public static class Builder cancelEntityReconciliationJobSettings; private final UnaryCallSettings.Builder deleteEntityReconciliationJobSettings; + private final UnaryCallSettings.Builder lookupSettings; + private final UnaryCallSettings.Builder searchSettings; + private final UnaryCallSettings.Builder + lookupPublicKgSettings; + private final UnaryCallSettings.Builder + searchPublicKgSettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -386,6 +430,7 @@ public static class Builder definitions.put( "retry_policy_0_codes", ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -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(); } @@ -429,6 +476,10 @@ 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.>of( @@ -436,7 +487,11 @@ protected Builder(ClientContext clientContext) { getEntityReconciliationJobSettings, listEntityReconciliationJobsSettings, cancelEntityReconciliationJobSettings, - deleteEntityReconciliationJobSettings); + deleteEntityReconciliationJobSettings, + lookupSettings, + searchSettings, + lookupPublicKgSettings, + searchPublicKgSettings); initDefaults(this); } @@ -452,6 +507,10 @@ 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.>of( @@ -459,7 +518,11 @@ protected Builder(EnterpriseKnowledgeGraphServiceStubSettings settings) { getEntityReconciliationJobSettings, listEntityReconciliationJobsSettings, cancelEntityReconciliationJobSettings, - deleteEntityReconciliationJobSettings); + deleteEntityReconciliationJobSettings, + lookupSettings, + searchSettings, + lookupPublicKgSettings, + searchPublicKgSettings); } private static Builder createDefault() { @@ -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; } @@ -565,6 +648,28 @@ public Builder applyToAllUnaryMethods( return deleteEntityReconciliationJobSettings; } + /** Returns the builder for the settings used for calls to lookup. */ + public UnaryCallSettings.Builder lookupSettings() { + return lookupSettings; + } + + /** Returns the builder for the settings used for calls to search. */ + public UnaryCallSettings.Builder searchSettings() { + return searchSettings; + } + + /** Returns the builder for the settings used for calls to lookupPublicKg. */ + public UnaryCallSettings.Builder + lookupPublicKgSettings() { + return lookupPublicKgSettings; + } + + /** Returns the builder for the settings used for calls to searchPublicKg. */ + public UnaryCallSettings.Builder + searchPublicKgSettings() { + return searchPublicKgSettings; + } + @Override public EnterpriseKnowledgeGraphServiceStubSettings build() throws IOException { return new EnterpriseKnowledgeGraphServiceStubSettings(this); diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/GrpcEnterpriseKnowledgeGraphServiceStub.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/GrpcEnterpriseKnowledgeGraphServiceStub.java index 8cc337906f36..50c7fd7b7b16 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/GrpcEnterpriseKnowledgeGraphServiceStub.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/GrpcEnterpriseKnowledgeGraphServiceStub.java @@ -31,6 +31,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.ImmutableMap; import com.google.longrunning.stub.GrpcOperationsStub; import com.google.protobuf.Empty; @@ -111,6 +119,48 @@ public class GrpcEnterpriseKnowledgeGraphServiceStub extends EnterpriseKnowledge .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) .build(); + private static final MethodDescriptor lookupMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/Lookup") + .setRequestMarshaller(ProtoUtils.marshaller(LookupRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(LookupResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor searchMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/Search") + .setRequestMarshaller(ProtoUtils.marshaller(SearchRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(SearchResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + lookupPublicKgMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/LookupPublicKg") + .setRequestMarshaller( + ProtoUtils.marshaller(LookupPublicKgRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(LookupPublicKgResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + searchPublicKgMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/SearchPublicKg") + .setRequestMarshaller( + ProtoUtils.marshaller(SearchPublicKgRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(SearchPublicKgResponse.getDefaultInstance())) + .build(); + private final UnaryCallable createEntityReconciliationJobCallable; private final UnaryCallable @@ -125,6 +175,10 @@ public class GrpcEnterpriseKnowledgeGraphServiceStub extends EnterpriseKnowledge cancelEntityReconciliationJobCallable; private final UnaryCallable deleteEntityReconciliationJobCallable; + private final UnaryCallable lookupCallable; + private final UnaryCallable searchCallable; + private final UnaryCallable lookupPublicKgCallable; + private final UnaryCallable searchPublicKgCallable; private final BackgroundResource backgroundResources; private final GrpcOperationsStub operationsStub; @@ -232,6 +286,48 @@ protected GrpcEnterpriseKnowledgeGraphServiceStub( return params.build(); }) .build(); + GrpcCallSettings lookupTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(lookupMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings searchTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + lookupPublicKgTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(lookupPublicKgMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + searchPublicKgTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(searchPublicKgMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); this.createEntityReconciliationJobCallable = callableFactory.createUnaryCallable( @@ -263,6 +359,18 @@ protected GrpcEnterpriseKnowledgeGraphServiceStub( deleteEntityReconciliationJobTransportSettings, settings.deleteEntityReconciliationJobSettings(), clientContext); + this.lookupCallable = + callableFactory.createUnaryCallable( + lookupTransportSettings, settings.lookupSettings(), clientContext); + this.searchCallable = + callableFactory.createUnaryCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + this.lookupPublicKgCallable = + callableFactory.createUnaryCallable( + lookupPublicKgTransportSettings, settings.lookupPublicKgSettings(), clientContext); + this.searchPublicKgCallable = + callableFactory.createUnaryCallable( + searchPublicKgTransportSettings, settings.searchPublicKgSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -309,6 +417,26 @@ public GrpcOperationsStub getOperationsStub() { return deleteEntityReconciliationJobCallable; } + @Override + public UnaryCallable lookupCallable() { + return lookupCallable; + } + + @Override + public UnaryCallable searchCallable() { + return searchCallable; + } + + @Override + public UnaryCallable lookupPublicKgCallable() { + return lookupPublicKgCallable; + } + + @Override + public UnaryCallable searchPublicKgCallable() { + return searchPublicKgCallable; + } + @Override public final void close() { try { diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/HttpJsonEnterpriseKnowledgeGraphServiceStub.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/HttpJsonEnterpriseKnowledgeGraphServiceStub.java index 9d72346f45ba..b03d381986ff 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/HttpJsonEnterpriseKnowledgeGraphServiceStub.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/stub/HttpJsonEnterpriseKnowledgeGraphServiceStub.java @@ -37,6 +37,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 com.google.protobuf.TypeRegistry; import java.io.IOException; @@ -248,6 +256,154 @@ public class HttpJsonEnterpriseKnowledgeGraphServiceStub .build()) .build(); + private static final ApiMethodDescriptor lookupMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/Lookup") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/cloudKnowledgeGraphEntities:Lookup", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "ids", request.getIdsList()); + serializer.putQueryParam(fields, "languages", request.getLanguagesList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(LookupResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor searchMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/Search") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/cloudKnowledgeGraphEntities:Search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "languages", request.getLanguagesList()); + serializer.putQueryParam(fields, "limit", request.getLimit()); + serializer.putQueryParam(fields, "query", request.getQuery()); + serializer.putQueryParam(fields, "types", request.getTypesList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + lookupPublicKgMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/LookupPublicKg") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/publicKnowledgeGraphEntities:Lookup", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "ids", request.getIdsList()); + serializer.putQueryParam( + fields, "languages", request.getLanguagesList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(LookupPublicKgResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + searchPublicKgMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService/SearchPublicKg") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/publicKnowledgeGraphEntities:Search", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam( + fields, "languages", request.getLanguagesList()); + serializer.putQueryParam(fields, "limit", request.getLimit()); + serializer.putQueryParam(fields, "query", request.getQuery()); + serializer.putQueryParam(fields, "types", request.getTypesList()); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(SearchPublicKgResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + private final UnaryCallable createEntityReconciliationJobCallable; private final UnaryCallable @@ -262,6 +418,10 @@ public class HttpJsonEnterpriseKnowledgeGraphServiceStub cancelEntityReconciliationJobCallable; private final UnaryCallable deleteEntityReconciliationJobCallable; + private final UnaryCallable lookupCallable; + private final UnaryCallable searchCallable; + private final UnaryCallable lookupPublicKgCallable; + private final UnaryCallable searchPublicKgCallable; private final BackgroundResource backgroundResources; private final HttpJsonStubCallableFactory callableFactory; @@ -343,6 +503,28 @@ protected HttpJsonEnterpriseKnowledgeGraphServiceStub( .setMethodDescriptor(deleteEntityReconciliationJobMethodDescriptor) .setTypeRegistry(typeRegistry) .build(); + HttpJsonCallSettings lookupTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(lookupMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings searchTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + lookupPublicKgTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(lookupPublicKgMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); + HttpJsonCallSettings + searchPublicKgTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(searchPublicKgMethodDescriptor) + .setTypeRegistry(typeRegistry) + .build(); this.createEntityReconciliationJobCallable = callableFactory.createUnaryCallable( @@ -374,6 +556,18 @@ protected HttpJsonEnterpriseKnowledgeGraphServiceStub( deleteEntityReconciliationJobTransportSettings, settings.deleteEntityReconciliationJobSettings(), clientContext); + this.lookupCallable = + callableFactory.createUnaryCallable( + lookupTransportSettings, settings.lookupSettings(), clientContext); + this.searchCallable = + callableFactory.createUnaryCallable( + searchTransportSettings, settings.searchSettings(), clientContext); + this.lookupPublicKgCallable = + callableFactory.createUnaryCallable( + lookupPublicKgTransportSettings, settings.lookupPublicKgSettings(), clientContext); + this.searchPublicKgCallable = + callableFactory.createUnaryCallable( + searchPublicKgTransportSettings, settings.searchPublicKgSettings(), clientContext); this.backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); @@ -387,6 +581,10 @@ public static List getMethodDescriptors() { methodDescriptors.add(listEntityReconciliationJobsMethodDescriptor); methodDescriptors.add(cancelEntityReconciliationJobMethodDescriptor); methodDescriptors.add(deleteEntityReconciliationJobMethodDescriptor); + methodDescriptors.add(lookupMethodDescriptor); + methodDescriptors.add(searchMethodDescriptor); + methodDescriptors.add(lookupPublicKgMethodDescriptor); + methodDescriptors.add(searchPublicKgMethodDescriptor); return methodDescriptors; } @@ -427,6 +625,26 @@ public static List getMethodDescriptors() { return deleteEntityReconciliationJobCallable; } + @Override + public UnaryCallable lookupCallable() { + return lookupCallable; + } + + @Override + public UnaryCallable searchCallable() { + return searchCallable; + } + + @Override + public UnaryCallable lookupPublicKgCallable() { + return lookupPublicKgCallable; + } + + @Override + public UnaryCallable searchPublicKgCallable() { + return searchPublicKgCallable; + } + @Override public final void close() { try { diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientHttpJsonTest.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientHttpJsonTest.java index a1699c3a0f3a..d5a7d7eeda5d 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientHttpJsonTest.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientHttpJsonTest.java @@ -30,9 +30,12 @@ import com.google.cloud.enterpriseknowledgegraph.v1.stub.HttpJsonEnterpriseKnowledgeGraphServiceStub; import com.google.common.collect.Lists; import com.google.protobuf.Empty; +import com.google.protobuf.ListValue; import com.google.protobuf.Timestamp; +import com.google.protobuf.Value; import com.google.rpc.Status; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import javax.annotation.Generated; @@ -581,4 +584,388 @@ public void deleteEntityReconciliationJobExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void lookupTest() throws Exception { + LookupResponse expectedResponse = + LookupResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + + LookupResponse actualResponse = client.lookup(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + client.lookup(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupTest2() throws Exception { + LookupResponse expectedResponse = + LookupResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + List ids = new ArrayList<>(); + + LookupResponse actualResponse = client.lookup(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + List ids = new ArrayList<>(); + client.lookup(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchTest() throws Exception { + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchResponse actualResponse = client.search(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.search(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchTest2() throws Exception { + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + String query = "query107944136"; + + SearchResponse actualResponse = client.search(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + String query = "query107944136"; + client.search(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupPublicKgTest() throws Exception { + LookupPublicKgResponse expectedResponse = + LookupPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + + LookupPublicKgResponse actualResponse = client.lookupPublicKg(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupPublicKgExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + client.lookupPublicKg(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupPublicKgTest2() throws Exception { + LookupPublicKgResponse expectedResponse = + LookupPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + List ids = new ArrayList<>(); + + LookupPublicKgResponse actualResponse = client.lookupPublicKg(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void lookupPublicKgExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + List ids = new ArrayList<>(); + client.lookupPublicKg(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchPublicKgTest() throws Exception { + SearchPublicKgResponse expectedResponse = + SearchPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchPublicKgResponse actualResponse = client.searchPublicKg(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchPublicKgExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.searchPublicKg(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchPublicKgTest2() throws Exception { + SearchPublicKgResponse expectedResponse = + SearchPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + String query = "query107944136"; + + SearchPublicKgResponse actualResponse = client.searchPublicKg(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void searchPublicKgExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + String query = "query107944136"; + client.searchPublicKg(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientTest.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientTest.java index cac945e13df3..8d98394bcbac 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientTest.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceClientTest.java @@ -28,10 +28,13 @@ import com.google.common.collect.Lists; import com.google.protobuf.AbstractMessage; import com.google.protobuf.Empty; +import com.google.protobuf.ListValue; import com.google.protobuf.Timestamp; +import com.google.protobuf.Value; import com.google.rpc.Status; import io.grpc.StatusRuntimeException; import java.io.IOException; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.UUID; @@ -531,4 +534,348 @@ public void deleteEntityReconciliationJobExceptionTest2() throws Exception { // Expected exception. } } + + @Test + public void lookupTest() throws Exception { + LookupResponse expectedResponse = + LookupResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + + LookupResponse actualResponse = client.lookup(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupRequest actualRequest = ((LookupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(ids, actualRequest.getIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + client.lookup(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupTest2() throws Exception { + LookupResponse expectedResponse = + LookupResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + List ids = new ArrayList<>(); + + LookupResponse actualResponse = client.lookup(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupRequest actualRequest = ((LookupRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(ids, actualRequest.getIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + String parent = "parent-995424086"; + List ids = new ArrayList<>(); + client.lookup(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchTest() throws Exception { + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchResponse actualResponse = client.search(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchRequest actualRequest = ((SearchRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.search(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchTest2() throws Exception { + SearchResponse expectedResponse = + SearchResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchResponse actualResponse = client.search(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchRequest actualRequest = ((SearchRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.search(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupPublicKgTest() throws Exception { + LookupPublicKgResponse expectedResponse = + LookupPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + + LookupPublicKgResponse actualResponse = client.lookupPublicKg(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupPublicKgRequest actualRequest = ((LookupPublicKgRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(ids, actualRequest.getIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupPublicKgExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + List ids = new ArrayList<>(); + client.lookupPublicKg(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void lookupPublicKgTest2() throws Exception { + LookupPublicKgResponse expectedResponse = + LookupPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + List ids = new ArrayList<>(); + + LookupPublicKgResponse actualResponse = client.lookupPublicKg(parent, ids); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + LookupPublicKgRequest actualRequest = ((LookupPublicKgRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(ids, actualRequest.getIdsList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void lookupPublicKgExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + String parent = "parent-995424086"; + List ids = new ArrayList<>(); + client.lookupPublicKg(parent, ids); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchPublicKgTest() throws Exception { + SearchPublicKgResponse expectedResponse = + SearchPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + + SearchPublicKgResponse actualResponse = client.searchPublicKg(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchPublicKgRequest actualRequest = ((SearchPublicKgRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchPublicKgExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + String query = "query107944136"; + client.searchPublicKg(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void searchPublicKgTest2() throws Exception { + SearchPublicKgResponse expectedResponse = + SearchPublicKgResponse.newBuilder() + .setContext(Value.newBuilder().setBoolValue(true).build()) + .setType(Value.newBuilder().setBoolValue(true).build()) + .setItemListElement(ListValue.newBuilder().build()) + .build(); + mockEnterpriseKnowledgeGraphService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + String query = "query107944136"; + + SearchPublicKgResponse actualResponse = client.searchPublicKg(parent, query); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockEnterpriseKnowledgeGraphService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + SearchPublicKgRequest actualRequest = ((SearchPublicKgRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertEquals(query, actualRequest.getQuery()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void searchPublicKgExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockEnterpriseKnowledgeGraphService.addException(exception); + + try { + String parent = "parent-995424086"; + String query = "query107944136"; + client.searchPublicKg(parent, query); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } } diff --git a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/MockEnterpriseKnowledgeGraphServiceImpl.java b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/MockEnterpriseKnowledgeGraphServiceImpl.java index 5a00e2efd36c..f5b163b01555 100644 --- a/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/MockEnterpriseKnowledgeGraphServiceImpl.java +++ b/java-enterpriseknowledgegraph/google-cloud-enterpriseknowledgegraph/src/test/java/com/google/cloud/enterpriseknowledgegraph/v1/MockEnterpriseKnowledgeGraphServiceImpl.java @@ -167,4 +167,86 @@ public void deleteEntityReconciliationJob( Exception.class.getName()))); } } + + @Override + public void lookup(LookupRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LookupResponse) { + requests.add(request); + responseObserver.onNext(((LookupResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Lookup, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LookupResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void search(SearchRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchResponse) { + requests.add(request); + responseObserver.onNext(((SearchResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method Search, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void lookupPublicKg( + LookupPublicKgRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof LookupPublicKgResponse) { + requests.add(request); + responseObserver.onNext(((LookupPublicKgResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method LookupPublicKg, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + LookupPublicKgResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void searchPublicKg( + SearchPublicKgRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof SearchPublicKgResponse) { + requests.add(request); + responseObserver.onNext(((SearchPublicKgResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SearchPublicKg, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + SearchPublicKgResponse.class.getName(), + Exception.class.getName()))); + } + } } diff --git a/java-enterpriseknowledgegraph/grpc-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceGrpc.java b/java-enterpriseknowledgegraph/grpc-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceGrpc.java index 2d1fec6f3770..bd73c781b67b 100644 --- a/java-enterpriseknowledgegraph/grpc-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceGrpc.java +++ b/java-enterpriseknowledgegraph/grpc-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/EnterpriseKnowledgeGraphServiceGrpc.java @@ -311,6 +311,200 @@ private EnterpriseKnowledgeGraphServiceGrpc() {} return getDeleteEntityReconciliationJobMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse> + getLookupMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Lookup", + requestType = com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.class, + responseType = com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse> + getLookupMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse> + getLookupMethod; + if ((getLookupMethod = EnterpriseKnowledgeGraphServiceGrpc.getLookupMethod) == null) { + synchronized (EnterpriseKnowledgeGraphServiceGrpc.class) { + if ((getLookupMethod = EnterpriseKnowledgeGraphServiceGrpc.getLookupMethod) == null) { + EnterpriseKnowledgeGraphServiceGrpc.getLookupMethod = + getLookupMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Lookup")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EnterpriseKnowledgeGraphServiceMethodDescriptorSupplier("Lookup")) + .build(); + } + } + } + return getLookupMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse> + getSearchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Search", + requestType = com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.class, + responseType = com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse> + getSearchMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse> + getSearchMethod; + if ((getSearchMethod = EnterpriseKnowledgeGraphServiceGrpc.getSearchMethod) == null) { + synchronized (EnterpriseKnowledgeGraphServiceGrpc.class) { + if ((getSearchMethod = EnterpriseKnowledgeGraphServiceGrpc.getSearchMethod) == null) { + EnterpriseKnowledgeGraphServiceGrpc.getSearchMethod = + getSearchMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Search")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EnterpriseKnowledgeGraphServiceMethodDescriptorSupplier("Search")) + .build(); + } + } + } + return getSearchMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse> + getLookupPublicKgMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "LookupPublicKg", + requestType = com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest.class, + responseType = com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse> + getLookupPublicKgMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse> + getLookupPublicKgMethod; + if ((getLookupPublicKgMethod = EnterpriseKnowledgeGraphServiceGrpc.getLookupPublicKgMethod) + == null) { + synchronized (EnterpriseKnowledgeGraphServiceGrpc.class) { + if ((getLookupPublicKgMethod = EnterpriseKnowledgeGraphServiceGrpc.getLookupPublicKgMethod) + == null) { + EnterpriseKnowledgeGraphServiceGrpc.getLookupPublicKgMethod = + getLookupPublicKgMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "LookupPublicKg")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EnterpriseKnowledgeGraphServiceMethodDescriptorSupplier( + "LookupPublicKg")) + .build(); + } + } + } + return getLookupPublicKgMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse> + getSearchPublicKgMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SearchPublicKg", + requestType = com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest.class, + responseType = com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse> + getSearchPublicKgMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse> + getSearchPublicKgMethod; + if ((getSearchPublicKgMethod = EnterpriseKnowledgeGraphServiceGrpc.getSearchPublicKgMethod) + == null) { + synchronized (EnterpriseKnowledgeGraphServiceGrpc.class) { + if ((getSearchPublicKgMethod = EnterpriseKnowledgeGraphServiceGrpc.getSearchPublicKgMethod) + == null) { + EnterpriseKnowledgeGraphServiceGrpc.getSearchPublicKgMethod = + getSearchPublicKgMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SearchPublicKg")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new EnterpriseKnowledgeGraphServiceMethodDescriptorSupplier( + "SearchPublicKg")) + .build(); + } + } + } + return getSearchPublicKgMethod; + } + /** Creates a new async stub that supports all call types for the service */ public static EnterpriseKnowledgeGraphServiceStub newStub(io.grpc.Channel channel) { io.grpc.stub.AbstractStub.StubFactory factory = @@ -443,6 +637,66 @@ public void deleteEntityReconciliationJob( getDeleteEntityReconciliationJobMethod(), responseObserver); } + /** + * + * + *
+     * Finds the Cloud KG entities with CKG ID(s).
+     * 
+ */ + public void lookup( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLookupMethod(), responseObserver); + } + + /** + * + * + *
+     * Searches the Cloud KG entities with entity name.
+     * 
+ */ + public void search( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSearchMethod(), responseObserver); + } + + /** + * + * + *
+     * Finds the public KG entities with public KG ID(s).
+     * 
+ */ + public void lookupPublicKg( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getLookupPublicKgMethod(), responseObserver); + } + + /** + * + * + *
+     * Searches the public KG entities with entity name.
+     * 
+ */ + public void searchPublicKg( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse> + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getSearchPublicKgMethod(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -485,6 +739,34 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.enterpriseknowledgegraph.v1 .DeleteEntityReconciliationJobRequest, com.google.protobuf.Empty>(this, METHODID_DELETE_ENTITY_RECONCILIATION_JOB))) + .addMethod( + getLookupMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse>( + this, METHODID_LOOKUP))) + .addMethod( + getSearchMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse>( + this, METHODID_SEARCH))) + .addMethod( + getLookupPublicKgMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse>( + this, METHODID_LOOKUP_PUBLIC_KG))) + .addMethod( + getSearchPublicKgMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse>( + this, METHODID_SEARCH_PUBLIC_KG))) .build(); } } @@ -598,6 +880,72 @@ public void deleteEntityReconciliationJob( request, responseObserver); } + + /** + * + * + *
+     * Finds the Cloud KG entities with CKG ID(s).
+     * 
+ */ + public void lookup( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLookupMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Searches the Cloud KG entities with entity name.
+     * 
+ */ + public void search( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Finds the public KG entities with public KG ID(s).
+     * 
+ */ + public void lookupPublicKg( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getLookupPublicKgMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Searches the public KG entities with entity name.
+     * 
+ */ + public void searchPublicKg( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse> + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getSearchPublicKgMethod(), getCallOptions()), + request, + responseObserver); + } } /** @@ -694,6 +1042,58 @@ public com.google.protobuf.Empty deleteEntityReconciliationJob( return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getDeleteEntityReconciliationJobMethod(), getCallOptions(), request); } + + /** + * + * + *
+     * Finds the Cloud KG entities with CKG ID(s).
+     * 
+ */ + public com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse lookup( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLookupMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Searches the Cloud KG entities with entity name.
+     * 
+ */ + public com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse search( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Finds the public KG entities with public KG ID(s).
+     * 
+ */ + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse lookupPublicKg( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getLookupPublicKgMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Searches the public KG entities with entity name.
+     * 
+ */ + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse searchPublicKg( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getSearchPublicKgMethod(), getCallOptions(), request); + } } /** @@ -800,6 +1200,62 @@ protected EnterpriseKnowledgeGraphServiceFutureStub build( getChannel().newCall(getDeleteEntityReconciliationJobMethod(), getCallOptions()), request); } + + /** + * + * + *
+     * Finds the Cloud KG entities with CKG ID(s).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse> + lookup(com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLookupMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Searches the Cloud KG entities with entity name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse> + search(com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Finds the public KG entities with public KG ID(s).
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse> + lookupPublicKg(com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getLookupPublicKgMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Searches the public KG entities with entity name.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse> + searchPublicKg(com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getSearchPublicKgMethod(), getCallOptions()), request); + } } private static final int METHODID_CREATE_ENTITY_RECONCILIATION_JOB = 0; @@ -807,6 +1263,10 @@ protected EnterpriseKnowledgeGraphServiceFutureStub build( private static final int METHODID_LIST_ENTITY_RECONCILIATION_JOBS = 2; private static final int METHODID_CANCEL_ENTITY_RECONCILIATION_JOB = 3; private static final int METHODID_DELETE_ENTITY_RECONCILIATION_JOB = 4; + private static final int METHODID_LOOKUP = 5; + private static final int METHODID_SEARCH = 6; + private static final int METHODID_LOOKUP_PUBLIC_KG = 7; + private static final int METHODID_SEARCH_PUBLIC_KG = 8; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -862,6 +1322,34 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_LOOKUP: + serviceImpl.lookup( + (com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse>) + responseObserver); + break; + case METHODID_SEARCH: + serviceImpl.search( + (com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse>) + responseObserver); + break; + case METHODID_LOOKUP_PUBLIC_KG: + serviceImpl.lookupPublicKg( + (com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse>) + responseObserver); + break; + case METHODID_SEARCH_PUBLIC_KG: + serviceImpl.searchPublicKg( + (com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse>) + responseObserver); + break; default: throw new AssertionError(); } @@ -932,6 +1420,10 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListEntityReconciliationJobsMethod()) .addMethod(getCancelEntityReconciliationJobMethod()) .addMethod(getDeleteEntityReconciliationJobMethod()) + .addMethod(getLookupMethod()) + .addMethod(getSearchMethod()) + .addMethod(getLookupPublicKgMethod()) + .addMethod(getSearchPublicKgMethod()) .build(); } } diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/CloudKnowledgeGraphEntityName.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/CloudKnowledgeGraphEntityName.java new file mode 100644 index 000000000000..c776033d07cf --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/CloudKnowledgeGraphEntityName.java @@ -0,0 +1,240 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.enterpriseknowledgegraph.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CloudKnowledgeGraphEntityName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_CLOUD_KNOWLEDGE_GRAPH_ENTITY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/cloudKnowledgeGraphEntities/{cloud_knowledge_graph_entity}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String cloudKnowledgeGraphEntity; + + @Deprecated + protected CloudKnowledgeGraphEntityName() { + project = null; + location = null; + cloudKnowledgeGraphEntity = null; + } + + private CloudKnowledgeGraphEntityName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + cloudKnowledgeGraphEntity = Preconditions.checkNotNull(builder.getCloudKnowledgeGraphEntity()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCloudKnowledgeGraphEntity() { + return cloudKnowledgeGraphEntity; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CloudKnowledgeGraphEntityName of( + String project, String location, String cloudKnowledgeGraphEntity) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCloudKnowledgeGraphEntity(cloudKnowledgeGraphEntity) + .build(); + } + + public static String format(String project, String location, String cloudKnowledgeGraphEntity) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setCloudKnowledgeGraphEntity(cloudKnowledgeGraphEntity) + .build() + .toString(); + } + + public static CloudKnowledgeGraphEntityName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_CLOUD_KNOWLEDGE_GRAPH_ENTITY.validatedMatch( + formattedString, + "CloudKnowledgeGraphEntityName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("cloud_knowledge_graph_entity")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (CloudKnowledgeGraphEntityName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_CLOUD_KNOWLEDGE_GRAPH_ENTITY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (cloudKnowledgeGraphEntity != null) { + fieldMapBuilder.put("cloud_knowledge_graph_entity", cloudKnowledgeGraphEntity); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_CLOUD_KNOWLEDGE_GRAPH_ENTITY.instantiate( + "project", + project, + "location", + location, + "cloud_knowledge_graph_entity", + cloudKnowledgeGraphEntity); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CloudKnowledgeGraphEntityName that = ((CloudKnowledgeGraphEntityName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.cloudKnowledgeGraphEntity, that.cloudKnowledgeGraphEntity); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(cloudKnowledgeGraphEntity); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/cloudKnowledgeGraphEntities/{cloud_knowledge_graph_entity}. + */ + public static class Builder { + private String project; + private String location; + private String cloudKnowledgeGraphEntity; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getCloudKnowledgeGraphEntity() { + return cloudKnowledgeGraphEntity; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setCloudKnowledgeGraphEntity(String cloudKnowledgeGraphEntity) { + this.cloudKnowledgeGraphEntity = cloudKnowledgeGraphEntity; + return this; + } + + private Builder(CloudKnowledgeGraphEntityName cloudKnowledgeGraphEntityName) { + this.project = cloudKnowledgeGraphEntityName.project; + this.location = cloudKnowledgeGraphEntityName.location; + this.cloudKnowledgeGraphEntity = cloudKnowledgeGraphEntityName.cloudKnowledgeGraphEntity; + } + + public CloudKnowledgeGraphEntityName build() { + return new CloudKnowledgeGraphEntityName(this); + } + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgRequest.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgRequest.java new file mode 100644 index 000000000000..475c8d06ac5b --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgRequest.java @@ -0,0 +1,1211 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Request message for
+ * [EnterpriseKnowledgeGraphService.LookupPublicKg][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.LookupPublicKg].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest} + */ +public final class LookupPublicKgRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) + LookupPublicKgRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupPublicKgRequest.newBuilder() to construct. + private LookupPublicKgRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupPublicKgRequest() { + parent_ = ""; + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupPublicKgRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ids_; + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ids. + */ + public com.google.protobuf.ProtocolStringList getIdsList() { + return ids_; + } + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ids. + */ + public int getIdsCount() { + return ids_.size(); + } + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + public java.lang.String getIds(int index) { + return ids_.get(index); + } + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + public com.google.protobuf.ByteString getIdsBytes(int index) { + return ids_.getByteString(index); + } + + public static final int LANGUAGES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList languages_; + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_; + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + for (int i = 0; i < ids_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ids_.getRaw(i)); + } + for (int i = 0; i < languages_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languages_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + { + int dataSize = 0; + for (int i = 0; i < ids_.size(); i++) { + dataSize += computeStringSizeNoTag(ids_.getRaw(i)); + } + size += dataSize; + size += 1 * getIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < languages_.size(); i++) { + dataSize += computeStringSizeNoTag(languages_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguagesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest other = + (com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getIdsList().equals(other.getIdsList())) return false; + if (!getLanguagesList().equals(other.getLanguagesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (getIdsCount() > 0) { + hash = (37 * hash) + IDS_FIELD_NUMBER; + hash = (53 * hash) + getIdsList().hashCode(); + } + if (getLanguagesCount() > 0) { + hash = (37 * hash) + LANGUAGES_FIELD_NUMBER; + hash = (53 * hash) + getLanguagesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EnterpriseKnowledgeGraphService.LookupPublicKg][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.LookupPublicKg].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest.Builder.class); + } + + // Construct using + // com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest build() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest result = + new com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + if (((bitField0_ & 0x00000001) != 0)) { + ids_ = ids_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ids_ = ids_; + if (((bitField0_ & 0x00000002) != 0)) { + languages_ = languages_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.languages_ = languages_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) { + return mergeFrom( + (com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest other) { + if (other + == com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.ids_.isEmpty()) { + if (ids_.isEmpty()) { + ids_ = other.ids_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIdsIsMutable(); + ids_.addAll(other.ids_); + } + onChanged(); + } + if (!other.languages_.isEmpty()) { + if (languages_.isEmpty()) { + languages_ = other.languages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLanguagesIsMutable(); + languages_.addAll(other.languages_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureIdsIsMutable(); + ids_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLanguagesIsMutable(); + languages_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ids_ = new com.google.protobuf.LazyStringArrayList(ids_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ids. + */ + public com.google.protobuf.ProtocolStringList getIdsList() { + return ids_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ids. + */ + public int getIdsCount() { + return ids_.size(); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + public java.lang.String getIds(int index) { + return ids_.get(index); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + public com.google.protobuf.ByteString getIdsBytes(int index) { + return ids_.getByteString(index); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The ids to set. + * @return This builder for chaining. + */ + public Builder setIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIdsIsMutable(); + ids_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The ids to add. + * @return This builder for chaining. + */ + public Builder addIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIdsIsMutable(); + ids_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The ids to add. + * @return This builder for chaining. + */ + public Builder addAllIds(java.lang.Iterable values) { + ensureIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ids_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearIds() { + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the ids to add. + * @return This builder for chaining. + */ + public Builder addIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIdsIsMutable(); + ids_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languages_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + languages_ = new com.google.protobuf.LazyStringArrayList(languages_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_.getUnmodifiableView(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index to set the value at. + * @param value The languages to set. + * @return This builder for chaining. + */ + public Builder setLanguages(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The languages to add. + * @return This builder for chaining. + */ + public Builder addLanguages(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param values The languages to add. + * @return This builder for chaining. + */ + public Builder addAllLanguages(java.lang.Iterable values) { + ensureLanguagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languages_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguages() { + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The bytes of the languages to add. + * @return This builder for chaining. + */ + public Builder addLanguagesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) + private static final com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupPublicKgRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgRequestOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgRequestOrBuilder.java new file mode 100644 index 000000000000..cd2985741e40 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface LookupPublicKgRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ids. + */ + java.util.List getIdsList(); + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ids. + */ + int getIdsCount(); + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + java.lang.String getIds(int index); + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + com.google.protobuf.ByteString getIdsBytes(int index); + + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + java.util.List getLanguagesList(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + int getLanguagesCount(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + java.lang.String getLanguages(int index); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + com.google.protobuf.ByteString getLanguagesBytes(int index); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgResponse.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgResponse.java new file mode 100644 index 000000000000..553590734891 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgResponse.java @@ -0,0 +1,1243 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Response message for
+ * [EnterpriseKnowledgeGraphService.LookupPublicKg][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.LookupPublicKg].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse} + */ +public final class LookupPublicKgResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) + LookupPublicKgResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupPublicKgResponse.newBuilder() to construct. + private LookupPublicKgResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupPublicKgResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupPublicKgResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse.Builder.class); + } + + public static final int CONTEXT_FIELD_NUMBER = 1; + private com.google.protobuf.Value context_; + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return context_ != null; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + @java.lang.Override + public com.google.protobuf.Value getContext() { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + return getContext(); + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.protobuf.Value type_; + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return type_ != null; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.protobuf.Value getType() { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + return getType(); + } + + public static final int ITEM_LIST_ELEMENT_FIELD_NUMBER = 3; + private com.google.protobuf.ListValue itemListElement_; + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + @java.lang.Override + public boolean hasItemListElement() { + return itemListElement_ != null; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + @java.lang.Override + public com.google.protobuf.ListValue getItemListElement() { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + return getItemListElement(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (context_ != null) { + output.writeMessage(1, getContext()); + } + if (type_ != null) { + output.writeMessage(2, getType()); + } + if (itemListElement_ != null) { + output.writeMessage(3, getItemListElement()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getContext()); + } + if (type_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + if (itemListElement_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getItemListElement()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse other = + (com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) obj; + + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (hasItemListElement() != other.hasItemListElement()) return false; + if (hasItemListElement()) { + if (!getItemListElement().equals(other.getItemListElement())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + if (hasItemListElement()) { + hash = (37 * hash) + ITEM_LIST_ELEMENT_FIELD_NUMBER; + hash = (53 * hash) + getItemListElement().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EnterpriseKnowledgeGraphService.LookupPublicKg][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.LookupPublicKg].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse.Builder.class); + } + + // Construct using + // com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextBuilder_ == null) { + context_ = null; + } else { + context_ = null; + contextBuilder_ = null; + } + if (typeBuilder_ == null) { + type_ = null; + } else { + type_ = null; + typeBuilder_ = null; + } + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse build() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse result = + new com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse(this); + if (contextBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = contextBuilder_.build(); + } + if (typeBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = typeBuilder_.build(); + } + if (itemListElementBuilder_ == null) { + result.itemListElement_ = itemListElement_; + } else { + result.itemListElement_ = itemListElementBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) { + return mergeFrom( + (com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse other) { + if (other + == com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + .getDefaultInstance()) return this; + if (other.hasContext()) { + mergeContext(other.getContext()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasItemListElement()) { + mergeItemListElement(other.getItemListElement()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getItemListElementFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.Value context_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + contextBuilder_; + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return contextBuilder_ != null || context_ != null; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + public com.google.protobuf.Value getContext() { + if (contextBuilder_ == null) { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + contextBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder mergeContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = com.google.protobuf.Value.newBuilder(context_).mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + contextBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder clearContext() { + if (contextBuilder_ == null) { + context_ = null; + onChanged(); + } else { + context_ = null; + contextBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.Value.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + private com.google.protobuf.Value type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + typeBuilder_; + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return typeBuilder_ != null || type_ != null; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + public com.google.protobuf.Value getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + typeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder mergeType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (type_ != null) { + type_ = com.google.protobuf.Value.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + typeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder clearType() { + if (typeBuilder_ == null) { + type_ = null; + onChanged(); + } else { + type_ = null; + typeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.Value.Builder getTypeBuilder() { + + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + private com.google.protobuf.ListValue itemListElement_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + itemListElementBuilder_; + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + public boolean hasItemListElement() { + return itemListElementBuilder_ != null || itemListElement_ != null; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + public com.google.protobuf.ListValue getItemListElement() { + if (itemListElementBuilder_ == null) { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } else { + return itemListElementBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + itemListElement_ = value; + onChanged(); + } else { + itemListElementBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue.Builder builderForValue) { + if (itemListElementBuilder_ == null) { + itemListElement_ = builderForValue.build(); + onChanged(); + } else { + itemListElementBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder mergeItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (itemListElement_ != null) { + itemListElement_ = + com.google.protobuf.ListValue.newBuilder(itemListElement_) + .mergeFrom(value) + .buildPartial(); + } else { + itemListElement_ = value; + } + onChanged(); + } else { + itemListElementBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder clearItemListElement() { + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + onChanged(); + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValue.Builder getItemListElementBuilder() { + + onChanged(); + return getItemListElementFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + if (itemListElementBuilder_ != null) { + return itemListElementBuilder_.getMessageOrBuilder(); + } else { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getItemListElementFieldBuilder() { + if (itemListElementBuilder_ == null) { + itemListElementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getItemListElement(), getParentForChildren(), isClean()); + itemListElement_ = null; + } + return itemListElementBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) + private static final com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupPublicKgResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgResponseOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgResponseOrBuilder.java new file mode 100644 index 000000000000..73506701ce8e --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupPublicKgResponseOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface LookupPublicKgResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.LookupPublicKgResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + com.google.protobuf.Value getContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + com.google.protobuf.ValueOrBuilder getContextOrBuilder(); + + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + com.google.protobuf.Value getType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + com.google.protobuf.ValueOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + boolean hasItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + com.google.protobuf.ListValue getItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder(); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupRequest.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupRequest.java new file mode 100644 index 000000000000..18b122ae9e2c --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupRequest.java @@ -0,0 +1,1201 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Request message for
+ * [EnterpriseKnowledgeGraphService.Lookup][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Lookup].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupRequest} + */ +public final class LookupRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.LookupRequest) + LookupRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupRequest.newBuilder() to construct. + private LookupRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupRequest() { + parent_ = ""; + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList ids_; + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ids. + */ + public com.google.protobuf.ProtocolStringList getIdsList() { + return ids_; + } + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ids. + */ + public int getIdsCount() { + return ids_.size(); + } + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + public java.lang.String getIds(int index) { + return ids_.get(index); + } + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + public com.google.protobuf.ByteString getIdsBytes(int index) { + return ids_.getByteString(index); + } + + public static final int LANGUAGES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList languages_; + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_; + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + for (int i = 0; i < ids_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ids_.getRaw(i)); + } + for (int i = 0; i < languages_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languages_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + { + int dataSize = 0; + for (int i = 0; i < ids_.size(); i++) { + dataSize += computeStringSizeNoTag(ids_.getRaw(i)); + } + size += dataSize; + size += 1 * getIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < languages_.size(); i++) { + dataSize += computeStringSizeNoTag(languages_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguagesList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest other = + (com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getIdsList().equals(other.getIdsList())) return false; + if (!getLanguagesList().equals(other.getLanguagesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (getIdsCount() > 0) { + hash = (37 * hash) + IDS_FIELD_NUMBER; + hash = (53 * hash) + getIdsList().hashCode(); + } + if (getLanguagesCount() > 0) { + hash = (37 * hash) + LANGUAGES_FIELD_NUMBER; + hash = (53 * hash) + getLanguagesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EnterpriseKnowledgeGraphService.Lookup][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Lookup].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.LookupRequest) + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.Builder.class); + } + + // Construct using com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest build() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest result = + new com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + if (((bitField0_ & 0x00000001) != 0)) { + ids_ = ids_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ids_ = ids_; + if (((bitField0_ & 0x00000002) != 0)) { + languages_ = languages_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.languages_ = languages_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest) { + return mergeFrom((com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest other) { + if (other == com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.ids_.isEmpty()) { + if (ids_.isEmpty()) { + ids_ = other.ids_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureIdsIsMutable(); + ids_.addAll(other.ids_); + } + onChanged(); + } + if (!other.languages_.isEmpty()) { + if (languages_.isEmpty()) { + languages_ = other.languages_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureLanguagesIsMutable(); + languages_.addAll(other.languages_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureIdsIsMutable(); + ids_.add(s); + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLanguagesIsMutable(); + languages_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ids_ = new com.google.protobuf.LazyStringArrayList(ids_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ids. + */ + public com.google.protobuf.ProtocolStringList getIdsList() { + return ids_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ids. + */ + public int getIdsCount() { + return ids_.size(); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + public java.lang.String getIds(int index) { + return ids_.get(index); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + public com.google.protobuf.ByteString getIdsBytes(int index) { + return ids_.getByteString(index); + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index to set the value at. + * @param value The ids to set. + * @return This builder for chaining. + */ + public Builder setIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIdsIsMutable(); + ids_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The ids to add. + * @return This builder for chaining. + */ + public Builder addIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIdsIsMutable(); + ids_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param values The ids to add. + * @return This builder for chaining. + */ + public Builder addAllIds(java.lang.Iterable values) { + ensureIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ids_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearIds() { + ids_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The list of entity ids to be used for lookup.
+     * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes of the ids to add. + * @return This builder for chaining. + */ + public Builder addIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureIdsIsMutable(); + ids_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languages_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguagesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + languages_ = new com.google.protobuf.LazyStringArrayList(languages_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_.getUnmodifiableView(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index to set the value at. + * @param value The languages to set. + * @return This builder for chaining. + */ + public Builder setLanguages(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The languages to add. + * @return This builder for chaining. + */ + public Builder addLanguages(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param values The languages to add. + * @return This builder for chaining. + */ + public Builder addAllLanguages(java.lang.Iterable values) { + ensureLanguagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languages_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguages() { + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The bytes of the languages to add. + * @return This builder for chaining. + */ + public Builder addLanguagesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.LookupRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.LookupRequest) + private static final com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupRequestOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupRequestOrBuilder.java new file mode 100644 index 000000000000..064fcd32ca48 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupRequestOrBuilder.java @@ -0,0 +1,164 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface LookupRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.LookupRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return A list containing the ids. + */ + java.util.List getIdsList(); + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The count of ids. + */ + int getIdsCount(); + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the element to return. + * @return The ids at the given index. + */ + java.lang.String getIds(int index); + /** + * + * + *
+   * Required. The list of entity ids to be used for lookup.
+   * 
+ * + * repeated string ids = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param index The index of the value to return. + * @return The bytes of the ids at the given index. + */ + com.google.protobuf.ByteString getIdsBytes(int index); + + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + java.util.List getLanguagesList(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + int getLanguagesCount(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + java.lang.String getLanguages(int index); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + com.google.protobuf.ByteString getLanguagesBytes(int index); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupResponse.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupResponse.java new file mode 100644 index 000000000000..9da776403b00 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupResponse.java @@ -0,0 +1,1233 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Response message for
+ * [EnterpriseKnowledgeGraphService.Lookup][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Lookup].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupResponse} + */ +public final class LookupResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.LookupResponse) + LookupResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use LookupResponse.newBuilder() to construct. + private LookupResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private LookupResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new LookupResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.Builder.class); + } + + public static final int CONTEXT_FIELD_NUMBER = 1; + private com.google.protobuf.Value context_; + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return context_ != null; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + @java.lang.Override + public com.google.protobuf.Value getContext() { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + return getContext(); + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.protobuf.Value type_; + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return type_ != null; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.protobuf.Value getType() { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + return getType(); + } + + public static final int ITEM_LIST_ELEMENT_FIELD_NUMBER = 3; + private com.google.protobuf.ListValue itemListElement_; + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + @java.lang.Override + public boolean hasItemListElement() { + return itemListElement_ != null; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + @java.lang.Override + public com.google.protobuf.ListValue getItemListElement() { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + return getItemListElement(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (context_ != null) { + output.writeMessage(1, getContext()); + } + if (type_ != null) { + output.writeMessage(2, getType()); + } + if (itemListElement_ != null) { + output.writeMessage(3, getItemListElement()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getContext()); + } + if (type_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + if (itemListElement_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getItemListElement()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse other = + (com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse) obj; + + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (hasItemListElement() != other.hasItemListElement()) return false; + if (hasItemListElement()) { + if (!getItemListElement().equals(other.getItemListElement())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + if (hasItemListElement()) { + hash = (37 * hash) + ITEM_LIST_ELEMENT_FIELD_NUMBER; + hash = (53 * hash) + getItemListElement().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EnterpriseKnowledgeGraphService.Lookup][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Lookup].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.LookupResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.LookupResponse) + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.Builder.class); + } + + // Construct using com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextBuilder_ == null) { + context_ = null; + } else { + context_ = null; + contextBuilder_ = null; + } + if (typeBuilder_ == null) { + type_ = null; + } else { + type_ = null; + typeBuilder_ = null; + } + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse build() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse result = + new com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse(this); + if (contextBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = contextBuilder_.build(); + } + if (typeBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = typeBuilder_.build(); + } + if (itemListElementBuilder_ == null) { + result.itemListElement_ = itemListElement_; + } else { + result.itemListElement_ = itemListElementBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse) { + return mergeFrom((com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse other) { + if (other == com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse.getDefaultInstance()) + return this; + if (other.hasContext()) { + mergeContext(other.getContext()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasItemListElement()) { + mergeItemListElement(other.getItemListElement()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getItemListElementFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.Value context_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + contextBuilder_; + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return contextBuilder_ != null || context_ != null; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + public com.google.protobuf.Value getContext() { + if (contextBuilder_ == null) { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + contextBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder mergeContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = com.google.protobuf.Value.newBuilder(context_).mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + contextBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder clearContext() { + if (contextBuilder_ == null) { + context_ = null; + onChanged(); + } else { + context_ = null; + contextBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.Value.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + private com.google.protobuf.Value type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + typeBuilder_; + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return typeBuilder_ != null || type_ != null; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + public com.google.protobuf.Value getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + typeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder mergeType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (type_ != null) { + type_ = com.google.protobuf.Value.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + typeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder clearType() { + if (typeBuilder_ == null) { + type_ = null; + onChanged(); + } else { + type_ = null; + typeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.Value.Builder getTypeBuilder() { + + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + private com.google.protobuf.ListValue itemListElement_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + itemListElementBuilder_; + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + public boolean hasItemListElement() { + return itemListElementBuilder_ != null || itemListElement_ != null; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + public com.google.protobuf.ListValue getItemListElement() { + if (itemListElementBuilder_ == null) { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } else { + return itemListElementBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + itemListElement_ = value; + onChanged(); + } else { + itemListElementBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue.Builder builderForValue) { + if (itemListElementBuilder_ == null) { + itemListElement_ = builderForValue.build(); + onChanged(); + } else { + itemListElementBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder mergeItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (itemListElement_ != null) { + itemListElement_ = + com.google.protobuf.ListValue.newBuilder(itemListElement_) + .mergeFrom(value) + .buildPartial(); + } else { + itemListElement_ = value; + } + onChanged(); + } else { + itemListElementBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder clearItemListElement() { + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + onChanged(); + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValue.Builder getItemListElementBuilder() { + + onChanged(); + return getItemListElementFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + if (itemListElementBuilder_ != null) { + return itemListElementBuilder_.getMessageOrBuilder(); + } else { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getItemListElementFieldBuilder() { + if (itemListElementBuilder_ == null) { + itemListElementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getItemListElement(), getParentForChildren(), isClean()); + itemListElement_ = null; + } + return itemListElementBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.LookupResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.LookupResponse) + private static final com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public LookupResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.LookupResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupResponseOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupResponseOrBuilder.java new file mode 100644 index 000000000000..a9855494e60e --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/LookupResponseOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface LookupResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.LookupResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + com.google.protobuf.Value getContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + com.google.protobuf.ValueOrBuilder getContextOrBuilder(); + + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + com.google.protobuf.Value getType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + com.google.protobuf.ValueOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + boolean hasItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + com.google.protobuf.ListValue getItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder(); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/PublicKnowledgeGraphEntityName.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/PublicKnowledgeGraphEntityName.java new file mode 100644 index 000000000000..18644656731c --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/PublicKnowledgeGraphEntityName.java @@ -0,0 +1,241 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.enterpriseknowledgegraph.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class PublicKnowledgeGraphEntityName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_PUBLIC_KNOWLEDGE_GRAPH_ENTITY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/publicKnowledgeGraphEntities/{public_knowledge_graph_entity}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String publicKnowledgeGraphEntity; + + @Deprecated + protected PublicKnowledgeGraphEntityName() { + project = null; + location = null; + publicKnowledgeGraphEntity = null; + } + + private PublicKnowledgeGraphEntityName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + publicKnowledgeGraphEntity = + Preconditions.checkNotNull(builder.getPublicKnowledgeGraphEntity()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPublicKnowledgeGraphEntity() { + return publicKnowledgeGraphEntity; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static PublicKnowledgeGraphEntityName of( + String project, String location, String publicKnowledgeGraphEntity) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setPublicKnowledgeGraphEntity(publicKnowledgeGraphEntity) + .build(); + } + + public static String format(String project, String location, String publicKnowledgeGraphEntity) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setPublicKnowledgeGraphEntity(publicKnowledgeGraphEntity) + .build() + .toString(); + } + + public static PublicKnowledgeGraphEntityName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_PUBLIC_KNOWLEDGE_GRAPH_ENTITY.validatedMatch( + formattedString, + "PublicKnowledgeGraphEntityName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("public_knowledge_graph_entity")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (PublicKnowledgeGraphEntityName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_PUBLIC_KNOWLEDGE_GRAPH_ENTITY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (publicKnowledgeGraphEntity != null) { + fieldMapBuilder.put("public_knowledge_graph_entity", publicKnowledgeGraphEntity); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_PUBLIC_KNOWLEDGE_GRAPH_ENTITY.instantiate( + "project", + project, + "location", + location, + "public_knowledge_graph_entity", + publicKnowledgeGraphEntity); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + PublicKnowledgeGraphEntityName that = ((PublicKnowledgeGraphEntityName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.publicKnowledgeGraphEntity, that.publicKnowledgeGraphEntity); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(publicKnowledgeGraphEntity); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/publicKnowledgeGraphEntities/{public_knowledge_graph_entity}. + */ + public static class Builder { + private String project; + private String location; + private String publicKnowledgeGraphEntity; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getPublicKnowledgeGraphEntity() { + return publicKnowledgeGraphEntity; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setPublicKnowledgeGraphEntity(String publicKnowledgeGraphEntity) { + this.publicKnowledgeGraphEntity = publicKnowledgeGraphEntity; + return this; + } + + private Builder(PublicKnowledgeGraphEntityName publicKnowledgeGraphEntityName) { + this.project = publicKnowledgeGraphEntityName.project; + this.location = publicKnowledgeGraphEntityName.location; + this.publicKnowledgeGraphEntity = publicKnowledgeGraphEntityName.publicKnowledgeGraphEntity; + } + + public PublicKnowledgeGraphEntityName build() { + return new PublicKnowledgeGraphEntityName(this); + } + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgRequest.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgRequest.java new file mode 100644 index 000000000000..7c1cd2dd234b --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgRequest.java @@ -0,0 +1,1675 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Request message for
+ * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest} + */ +public final class SearchPublicKgRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) + SearchPublicKgRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchPublicKgRequest.newBuilder() to construct. + private SearchPublicKgRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchPublicKgRequest() { + parent_ = ""; + query_ = ""; + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + types_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchPublicKgRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList languages_; + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_; + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + + public static final int TYPES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList types_; + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return A list containing the types. + */ + public com.google.protobuf.ProtocolStringList getTypesList() { + return types_; + } + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return The count of types. + */ + public int getTypesCount() { + return types_.size(); + } + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + public java.lang.String getTypes(int index) { + return types_.get(index); + } + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + public com.google.protobuf.ByteString getTypesBytes(int index) { + return types_.getByteString(index); + } + + public static final int LIMIT_FIELD_NUMBER = 6; + private com.google.protobuf.Int32Value limit_; + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return Whether the limit field is set. + */ + @java.lang.Override + public boolean hasLimit() { + return limit_ != null; + } + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return The limit. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getLimit() { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { + return getLimit(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + for (int i = 0; i < languages_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languages_.getRaw(i)); + } + for (int i = 0; i < types_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, types_.getRaw(i)); + } + if (limit_ != null) { + output.writeMessage(6, getLimit()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + { + int dataSize = 0; + for (int i = 0; i < languages_.size(); i++) { + dataSize += computeStringSizeNoTag(languages_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguagesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < types_.size(); i++) { + dataSize += computeStringSizeNoTag(types_.getRaw(i)); + } + size += dataSize; + size += 1 * getTypesList().size(); + } + if (limit_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getLimit()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest other = + (com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getLanguagesList().equals(other.getLanguagesList())) return false; + if (!getTypesList().equals(other.getTypesList())) return false; + if (hasLimit() != other.hasLimit()) return false; + if (hasLimit()) { + if (!getLimit().equals(other.getLimit())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + if (getLanguagesCount() > 0) { + hash = (37 * hash) + LANGUAGES_FIELD_NUMBER; + hash = (53 * hash) + getLanguagesList().hashCode(); + } + if (getTypesCount() > 0) { + hash = (37 * hash) + TYPES_FIELD_NUMBER; + hash = (53 * hash) + getTypesList().hashCode(); + } + if (hasLimit()) { + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest.Builder.class); + } + + // Construct using + // com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + query_ = ""; + + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + types_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (limitBuilder_ == null) { + limit_ = null; + } else { + limit_ = null; + limitBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest build() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest result = + new com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + result.query_ = query_; + if (((bitField0_ & 0x00000001) != 0)) { + languages_ = languages_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.languages_ = languages_; + if (((bitField0_ & 0x00000002) != 0)) { + types_ = types_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.types_ = types_; + if (limitBuilder_ == null) { + result.limit_ = limit_; + } else { + result.limit_ = limitBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) { + return mergeFrom( + (com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest other) { + if (other + == com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.languages_.isEmpty()) { + if (languages_.isEmpty()) { + languages_ = other.languages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLanguagesIsMutable(); + languages_.addAll(other.languages_); + } + onChanged(); + } + if (!other.types_.isEmpty()) { + if (types_.isEmpty()) { + types_ = other.types_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTypesIsMutable(); + types_.addAll(other.types_); + } + onChanged(); + } + if (other.hasLimit()) { + mergeLimit(other.getLimit()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + query_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLanguagesIsMutable(); + languages_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTypesIsMutable(); + types_.add(s); + break; + } // case 34 + case 50: + { + input.readMessage(getLimitFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languages_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + languages_ = new com.google.protobuf.LazyStringArrayList(languages_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_.getUnmodifiableView(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index to set the value at. + * @param value The languages to set. + * @return This builder for chaining. + */ + public Builder setLanguages(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The languages to add. + * @return This builder for chaining. + */ + public Builder addLanguages(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param values The languages to add. + * @return This builder for chaining. + */ + public Builder addAllLanguages(java.lang.Iterable values) { + ensureLanguagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languages_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguages() { + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The bytes of the languages to add. + * @return This builder for chaining. + */ + public Builder addLanguagesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList types_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + types_ = new com.google.protobuf.LazyStringArrayList(types_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @return A list containing the types. + */ + public com.google.protobuf.ProtocolStringList getTypesList() { + return types_.getUnmodifiableView(); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @return The count of types. + */ + public int getTypesCount() { + return types_.size(); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + public java.lang.String getTypes(int index) { + return types_.get(index); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + public com.google.protobuf.ByteString getTypesBytes(int index) { + return types_.getByteString(index); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param index The index to set the value at. + * @param value The types to set. + * @return This builder for chaining. + */ + public Builder setTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypesIsMutable(); + types_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param value The types to add. + * @return This builder for chaining. + */ + public Builder addTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypesIsMutable(); + types_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param values The types to add. + * @return This builder for chaining. + */ + public Builder addAllTypes(java.lang.Iterable values) { + ensureTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, types_); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @return This builder for chaining. + */ + public Builder clearTypes() { + types_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param value The bytes of the types to add. + * @return This builder for chaining. + */ + public Builder addTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTypesIsMutable(); + types_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value limit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + limitBuilder_; + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return Whether the limit field is set. + */ + public boolean hasLimit() { + return limitBuilder_ != null || limit_ != null; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return The limit. + */ + public com.google.protobuf.Int32Value getLimit() { + if (limitBuilder_ == null) { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } else { + return limitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder setLimit(com.google.protobuf.Int32Value value) { + if (limitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + limit_ = value; + onChanged(); + } else { + limitBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder setLimit(com.google.protobuf.Int32Value.Builder builderForValue) { + if (limitBuilder_ == null) { + limit_ = builderForValue.build(); + onChanged(); + } else { + limitBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder mergeLimit(com.google.protobuf.Int32Value value) { + if (limitBuilder_ == null) { + if (limit_ != null) { + limit_ = + com.google.protobuf.Int32Value.newBuilder(limit_).mergeFrom(value).buildPartial(); + } else { + limit_ = value; + } + onChanged(); + } else { + limitBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder clearLimit() { + if (limitBuilder_ == null) { + limit_ = null; + onChanged(); + } else { + limit_ = null; + limitBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public com.google.protobuf.Int32Value.Builder getLimitBuilder() { + + onChanged(); + return getLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { + if (limitBuilder_ != null) { + return limitBuilder_.getMessageOrBuilder(); + } else { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getLimitFieldBuilder() { + if (limitBuilder_ == null) { + limitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getLimit(), getParentForChildren(), isClean()); + limit_ = null; + } + return limitBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) + private static final com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchPublicKgRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgRequestOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgRequestOrBuilder.java new file mode 100644 index 000000000000..9a042b55d526 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgRequestOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface SearchPublicKgRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + java.util.List getLanguagesList(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + int getLanguagesCount(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + java.lang.String getLanguages(int index); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + com.google.protobuf.ByteString getLanguagesBytes(int index); + + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return A list containing the types. + */ + java.util.List getTypesList(); + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return The count of types. + */ + int getTypesCount(); + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + java.lang.String getTypes(int index); + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + com.google.protobuf.ByteString getTypesBytes(int index); + + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return Whether the limit field is set. + */ + boolean hasLimit(); + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return The limit. + */ + com.google.protobuf.Int32Value getLimit(); + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder(); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgResponse.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgResponse.java new file mode 100644 index 000000000000..ca74a0ec65fd --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgResponse.java @@ -0,0 +1,1243 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Response message for
+ * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse} + */ +public final class SearchPublicKgResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) + SearchPublicKgResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchPublicKgResponse.newBuilder() to construct. + private SearchPublicKgResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchPublicKgResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchPublicKgResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse.Builder.class); + } + + public static final int CONTEXT_FIELD_NUMBER = 1; + private com.google.protobuf.Value context_; + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return context_ != null; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + @java.lang.Override + public com.google.protobuf.Value getContext() { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + return getContext(); + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.protobuf.Value type_; + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return type_ != null; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.protobuf.Value getType() { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + return getType(); + } + + public static final int ITEM_LIST_ELEMENT_FIELD_NUMBER = 3; + private com.google.protobuf.ListValue itemListElement_; + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + @java.lang.Override + public boolean hasItemListElement() { + return itemListElement_ != null; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + @java.lang.Override + public com.google.protobuf.ListValue getItemListElement() { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + return getItemListElement(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (context_ != null) { + output.writeMessage(1, getContext()); + } + if (type_ != null) { + output.writeMessage(2, getType()); + } + if (itemListElement_ != null) { + output.writeMessage(3, getItemListElement()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getContext()); + } + if (type_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + if (itemListElement_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getItemListElement()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse other = + (com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) obj; + + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (hasItemListElement() != other.hasItemListElement()) return false; + if (hasItemListElement()) { + if (!getItemListElement().equals(other.getItemListElement())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + if (hasItemListElement()) { + hash = (37 * hash) + ITEM_LIST_ELEMENT_FIELD_NUMBER; + hash = (53 * hash) + getItemListElement().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse.Builder.class); + } + + // Construct using + // com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextBuilder_ == null) { + context_ = null; + } else { + context_ = null; + contextBuilder_ = null; + } + if (typeBuilder_ == null) { + type_ = null; + } else { + type_ = null; + typeBuilder_ = null; + } + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse build() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse result = + new com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse(this); + if (contextBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = contextBuilder_.build(); + } + if (typeBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = typeBuilder_.build(); + } + if (itemListElementBuilder_ == null) { + result.itemListElement_ = itemListElement_; + } else { + result.itemListElement_ = itemListElementBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) { + return mergeFrom( + (com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse other) { + if (other + == com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + .getDefaultInstance()) return this; + if (other.hasContext()) { + mergeContext(other.getContext()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasItemListElement()) { + mergeItemListElement(other.getItemListElement()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getItemListElementFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.Value context_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + contextBuilder_; + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return contextBuilder_ != null || context_ != null; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + public com.google.protobuf.Value getContext() { + if (contextBuilder_ == null) { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + contextBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder mergeContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = com.google.protobuf.Value.newBuilder(context_).mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + contextBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder clearContext() { + if (contextBuilder_ == null) { + context_ = null; + onChanged(); + } else { + context_ = null; + contextBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.Value.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + private com.google.protobuf.Value type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + typeBuilder_; + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return typeBuilder_ != null || type_ != null; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + public com.google.protobuf.Value getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + typeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder mergeType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (type_ != null) { + type_ = com.google.protobuf.Value.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + typeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder clearType() { + if (typeBuilder_ == null) { + type_ = null; + onChanged(); + } else { + type_ = null; + typeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.Value.Builder getTypeBuilder() { + + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + private com.google.protobuf.ListValue itemListElement_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + itemListElementBuilder_; + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + public boolean hasItemListElement() { + return itemListElementBuilder_ != null || itemListElement_ != null; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + public com.google.protobuf.ListValue getItemListElement() { + if (itemListElementBuilder_ == null) { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } else { + return itemListElementBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + itemListElement_ = value; + onChanged(); + } else { + itemListElementBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue.Builder builderForValue) { + if (itemListElementBuilder_ == null) { + itemListElement_ = builderForValue.build(); + onChanged(); + } else { + itemListElementBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder mergeItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (itemListElement_ != null) { + itemListElement_ = + com.google.protobuf.ListValue.newBuilder(itemListElement_) + .mergeFrom(value) + .buildPartial(); + } else { + itemListElement_ = value; + } + onChanged(); + } else { + itemListElementBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder clearItemListElement() { + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + onChanged(); + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValue.Builder getItemListElementBuilder() { + + onChanged(); + return getItemListElementFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + if (itemListElementBuilder_ != null) { + return itemListElementBuilder_.getMessageOrBuilder(); + } else { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getItemListElementFieldBuilder() { + if (itemListElementBuilder_ == null) { + itemListElementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getItemListElement(), getParentForChildren(), isClean()); + itemListElement_ = null; + } + return itemListElementBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) + private static final com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchPublicKgResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgResponseOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgResponseOrBuilder.java new file mode 100644 index 000000000000..7e53075e51a6 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchPublicKgResponseOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface SearchPublicKgResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.SearchPublicKgResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + com.google.protobuf.Value getContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + com.google.protobuf.ValueOrBuilder getContextOrBuilder(); + + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + com.google.protobuf.Value getType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + com.google.protobuf.ValueOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + boolean hasItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + com.google.protobuf.ListValue getItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder(); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchRequest.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchRequest.java new file mode 100644 index 000000000000..96efd4b4d50c --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchRequest.java @@ -0,0 +1,1665 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Request message for
+ * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchRequest} + */ +public final class SearchRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.SearchRequest) + SearchRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchRequest.newBuilder() to construct. + private SearchRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchRequest() { + parent_ = ""; + query_ = ""; + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + types_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int QUERY_FIELD_NUMBER = 2; + private volatile java.lang.Object query_; + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + @java.lang.Override + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + @java.lang.Override + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LANGUAGES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList languages_; + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_; + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + + public static final int TYPES_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList types_; + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return A list containing the types. + */ + public com.google.protobuf.ProtocolStringList getTypesList() { + return types_; + } + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return The count of types. + */ + public int getTypesCount() { + return types_.size(); + } + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + public java.lang.String getTypes(int index) { + return types_.get(index); + } + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + public com.google.protobuf.ByteString getTypesBytes(int index) { + return types_.getByteString(index); + } + + public static final int LIMIT_FIELD_NUMBER = 6; + private com.google.protobuf.Int32Value limit_; + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return Whether the limit field is set. + */ + @java.lang.Override + public boolean hasLimit() { + return limit_ != null; + } + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return The limit. + */ + @java.lang.Override + public com.google.protobuf.Int32Value getLimit() { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + @java.lang.Override + public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { + return getLimit(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, query_); + } + for (int i = 0; i < languages_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, languages_.getRaw(i)); + } + for (int i = 0; i < types_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, types_.getRaw(i)); + } + if (limit_ != null) { + output.writeMessage(6, getLimit()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(query_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, query_); + } + { + int dataSize = 0; + for (int i = 0; i < languages_.size(); i++) { + dataSize += computeStringSizeNoTag(languages_.getRaw(i)); + } + size += dataSize; + size += 1 * getLanguagesList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < types_.size(); i++) { + dataSize += computeStringSizeNoTag(types_.getRaw(i)); + } + size += dataSize; + size += 1 * getTypesList().size(); + } + if (limit_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getLimit()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest other = + (com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getQuery().equals(other.getQuery())) return false; + if (!getLanguagesList().equals(other.getLanguagesList())) return false; + if (!getTypesList().equals(other.getTypesList())) return false; + if (hasLimit() != other.hasLimit()) return false; + if (hasLimit()) { + if (!getLimit().equals(other.getLimit())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + QUERY_FIELD_NUMBER; + hash = (53 * hash) + getQuery().hashCode(); + if (getLanguagesCount() > 0) { + hash = (37 * hash) + LANGUAGES_FIELD_NUMBER; + hash = (53 * hash) + getLanguagesList().hashCode(); + } + if (getTypesCount() > 0) { + hash = (37 * hash) + TYPES_FIELD_NUMBER; + hash = (53 * hash) + getTypesList().hashCode(); + } + if (hasLimit()) { + hash = (37 * hash) + LIMIT_FIELD_NUMBER; + hash = (53 * hash) + getLimit().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for
+   * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.SearchRequest) + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.Builder.class); + } + + // Construct using com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + query_ = ""; + + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + types_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (limitBuilder_ == null) { + limit_ = null; + } else { + limit_ = null; + limitBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest build() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest result = + new com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + result.query_ = query_; + if (((bitField0_ & 0x00000001) != 0)) { + languages_ = languages_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.languages_ = languages_; + if (((bitField0_ & 0x00000002) != 0)) { + types_ = types_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.types_ = types_; + if (limitBuilder_ == null) { + result.limit_ = limit_; + } else { + result.limit_ = limitBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest) { + return mergeFrom((com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest other) { + if (other == com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getQuery().isEmpty()) { + query_ = other.query_; + onChanged(); + } + if (!other.languages_.isEmpty()) { + if (languages_.isEmpty()) { + languages_ = other.languages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLanguagesIsMutable(); + languages_.addAll(other.languages_); + } + onChanged(); + } + if (!other.types_.isEmpty()) { + if (types_.isEmpty()) { + types_ = other.types_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureTypesIsMutable(); + types_.addAll(other.types_); + } + onChanged(); + } + if (other.hasLimit()) { + mergeLimit(other.getLimit()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + query_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureLanguagesIsMutable(); + languages_.add(s); + break; + } // case 26 + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureTypesIsMutable(); + types_.add(s); + break; + } // case 34 + case 50: + { + input.readMessage(getLimitFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the Entity's parent resource.
+     * Format:
+     * `projects/{project}/locations/{location}`
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object query_ = ""; + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + public java.lang.String getQuery() { + java.lang.Object ref = query_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + query_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + public com.google.protobuf.ByteString getQueryBytes() { + java.lang.Object ref = query_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + query_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The query to set. + * @return This builder for chaining. + */ + public Builder setQuery(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + query_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearQuery() { + + query_ = getDefaultInstance().getQuery(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The literal query string for search.
+     * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for query to set. + * @return This builder for chaining. + */ + public Builder setQueryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + query_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList languages_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLanguagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + languages_ = new com.google.protobuf.LazyStringArrayList(languages_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + public com.google.protobuf.ProtocolStringList getLanguagesList() { + return languages_.getUnmodifiableView(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + public int getLanguagesCount() { + return languages_.size(); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + public java.lang.String getLanguages(int index) { + return languages_.get(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + public com.google.protobuf.ByteString getLanguagesBytes(int index) { + return languages_.getByteString(index); + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param index The index to set the value at. + * @param value The languages to set. + * @return This builder for chaining. + */ + public Builder setLanguages(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The languages to add. + * @return This builder for chaining. + */ + public Builder addLanguages(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param values The languages to add. + * @return This builder for chaining. + */ + public Builder addAllLanguages(java.lang.Iterable values) { + ensureLanguagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, languages_); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @return This builder for chaining. + */ + public Builder clearLanguages() { + languages_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The list of language codes (defined in ISO 693) to run the query with,
+     * e.g. 'en'.
+     * 
+ * + * repeated string languages = 3; + * + * @param value The bytes of the languages to add. + * @return This builder for chaining. + */ + public Builder addLanguagesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLanguagesIsMutable(); + languages_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList types_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + types_ = new com.google.protobuf.LazyStringArrayList(types_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @return A list containing the types. + */ + public com.google.protobuf.ProtocolStringList getTypesList() { + return types_.getUnmodifiableView(); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @return The count of types. + */ + public int getTypesCount() { + return types_.size(); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + public java.lang.String getTypes(int index) { + return types_.get(index); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + public com.google.protobuf.ByteString getTypesBytes(int index) { + return types_.getByteString(index); + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param index The index to set the value at. + * @param value The types to set. + * @return This builder for chaining. + */ + public Builder setTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypesIsMutable(); + types_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param value The types to add. + * @return This builder for chaining. + */ + public Builder addTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureTypesIsMutable(); + types_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param values The types to add. + * @return This builder for chaining. + */ + public Builder addAllTypes(java.lang.Iterable values) { + ensureTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, types_); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @return This builder for chaining. + */ + public Builder clearTypes() { + types_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Restricts returned entities with these types, e.g. Person
+     * (as defined in http://schema.org/Person). If multiple types are specified,
+     * returned entities will contain one or more of these types.
+     * 
+ * + * repeated string types = 4; + * + * @param value The bytes of the types to add. + * @return This builder for chaining. + */ + public Builder addTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureTypesIsMutable(); + types_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Int32Value limit_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + limitBuilder_; + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return Whether the limit field is set. + */ + public boolean hasLimit() { + return limitBuilder_ != null || limit_ != null; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return The limit. + */ + public com.google.protobuf.Int32Value getLimit() { + if (limitBuilder_ == null) { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } else { + return limitBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder setLimit(com.google.protobuf.Int32Value value) { + if (limitBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + limit_ = value; + onChanged(); + } else { + limitBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder setLimit(com.google.protobuf.Int32Value.Builder builderForValue) { + if (limitBuilder_ == null) { + limit_ = builderForValue.build(); + onChanged(); + } else { + limitBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder mergeLimit(com.google.protobuf.Int32Value value) { + if (limitBuilder_ == null) { + if (limit_ != null) { + limit_ = + com.google.protobuf.Int32Value.newBuilder(limit_).mergeFrom(value).buildPartial(); + } else { + limit_ = value; + } + onChanged(); + } else { + limitBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public Builder clearLimit() { + if (limitBuilder_ == null) { + limit_ = null; + onChanged(); + } else { + limit_ = null; + limitBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public com.google.protobuf.Int32Value.Builder getLimitBuilder() { + + onChanged(); + return getLimitFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + public com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder() { + if (limitBuilder_ != null) { + return limitBuilder_.getMessageOrBuilder(); + } else { + return limit_ == null ? com.google.protobuf.Int32Value.getDefaultInstance() : limit_; + } + } + /** + * + * + *
+     * Limits the number of entities to be returned.
+     * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder> + getLimitFieldBuilder() { + if (limitBuilder_ == null) { + limitBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Int32Value, + com.google.protobuf.Int32Value.Builder, + com.google.protobuf.Int32ValueOrBuilder>( + getLimit(), getParentForChildren(), isClean()); + limit_ = null; + } + return limitBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.SearchRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.SearchRequest) + private static final com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchRequestOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchRequestOrBuilder.java new file mode 100644 index 000000000000..a53bb5f51076 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchRequestOrBuilder.java @@ -0,0 +1,232 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface SearchRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.SearchRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the Entity's parent resource.
+   * Format:
+   * `projects/{project}/locations/{location}`
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The query. + */ + java.lang.String getQuery(); + /** + * + * + *
+   * Required. The literal query string for search.
+   * 
+ * + * string query = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for query. + */ + com.google.protobuf.ByteString getQueryBytes(); + + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return A list containing the languages. + */ + java.util.List getLanguagesList(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @return The count of languages. + */ + int getLanguagesCount(); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the element to return. + * @return The languages at the given index. + */ + java.lang.String getLanguages(int index); + /** + * + * + *
+   * The list of language codes (defined in ISO 693) to run the query with,
+   * e.g. 'en'.
+   * 
+ * + * repeated string languages = 3; + * + * @param index The index of the value to return. + * @return The bytes of the languages at the given index. + */ + com.google.protobuf.ByteString getLanguagesBytes(int index); + + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return A list containing the types. + */ + java.util.List getTypesList(); + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @return The count of types. + */ + int getTypesCount(); + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the element to return. + * @return The types at the given index. + */ + java.lang.String getTypes(int index); + /** + * + * + *
+   * Restricts returned entities with these types, e.g. Person
+   * (as defined in http://schema.org/Person). If multiple types are specified,
+   * returned entities will contain one or more of these types.
+   * 
+ * + * repeated string types = 4; + * + * @param index The index of the value to return. + * @return The bytes of the types at the given index. + */ + com.google.protobuf.ByteString getTypesBytes(int index); + + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return Whether the limit field is set. + */ + boolean hasLimit(); + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + * + * @return The limit. + */ + com.google.protobuf.Int32Value getLimit(); + /** + * + * + *
+   * Limits the number of entities to be returned.
+   * 
+ * + * .google.protobuf.Int32Value limit = 6; + */ + com.google.protobuf.Int32ValueOrBuilder getLimitOrBuilder(); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchResponse.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchResponse.java new file mode 100644 index 000000000000..d0d794d0dcaa --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchResponse.java @@ -0,0 +1,1233 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +/** + * + * + *
+ * Response message for
+ * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+ * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchResponse} + */ +public final class SearchResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.enterpriseknowledgegraph.v1.SearchResponse) + SearchResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SearchResponse.newBuilder() to construct. + private SearchResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private SearchResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new SearchResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.Builder.class); + } + + public static final int CONTEXT_FIELD_NUMBER = 1; + private com.google.protobuf.Value context_; + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + @java.lang.Override + public boolean hasContext() { + return context_ != null; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + @java.lang.Override + public com.google.protobuf.Value getContext() { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + return getContext(); + } + + public static final int TYPE_FIELD_NUMBER = 2; + private com.google.protobuf.Value type_; + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + @java.lang.Override + public boolean hasType() { + return type_ != null; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + @java.lang.Override + public com.google.protobuf.Value getType() { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + @java.lang.Override + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + return getType(); + } + + public static final int ITEM_LIST_ELEMENT_FIELD_NUMBER = 3; + private com.google.protobuf.ListValue itemListElement_; + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + @java.lang.Override + public boolean hasItemListElement() { + return itemListElement_ != null; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + @java.lang.Override + public com.google.protobuf.ListValue getItemListElement() { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + @java.lang.Override + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + return getItemListElement(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (context_ != null) { + output.writeMessage(1, getContext()); + } + if (type_ != null) { + output.writeMessage(2, getType()); + } + if (itemListElement_ != null) { + output.writeMessage(3, getItemListElement()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (context_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getContext()); + } + if (type_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getType()); + } + if (itemListElement_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getItemListElement()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse)) { + return super.equals(obj); + } + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse other = + (com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse) obj; + + if (hasContext() != other.hasContext()) return false; + if (hasContext()) { + if (!getContext().equals(other.getContext())) return false; + } + if (hasType() != other.hasType()) return false; + if (hasType()) { + if (!getType().equals(other.getType())) return false; + } + if (hasItemListElement() != other.hasItemListElement()) return false; + if (hasItemListElement()) { + if (!getItemListElement().equals(other.getItemListElement())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasContext()) { + hash = (37 * hash) + CONTEXT_FIELD_NUMBER; + hash = (53 * hash) + getContext().hashCode(); + } + if (hasType()) { + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + } + if (hasItemListElement()) { + hash = (37 * hash) + ITEM_LIST_ELEMENT_FIELD_NUMBER; + hash = (53 * hash) + getItemListElement().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for
+   * [EnterpriseKnowledgeGraphService.Search][google.cloud.enterpriseknowledgegraph.v1.EnterpriseKnowledgeGraphService.Search].
+   * 
+ * + * Protobuf type {@code google.cloud.enterpriseknowledgegraph.v1.SearchResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.enterpriseknowledgegraph.v1.SearchResponse) + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.class, + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.Builder.class); + } + + // Construct using com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (contextBuilder_ == null) { + context_ = null; + } else { + context_ = null; + contextBuilder_ = null; + } + if (typeBuilder_ == null) { + type_ = null; + } else { + type_ = null; + typeBuilder_ = null; + } + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.ServiceProto + .internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse getDefaultInstanceForType() { + return com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse build() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse buildPartial() { + com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse result = + new com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse(this); + if (contextBuilder_ == null) { + result.context_ = context_; + } else { + result.context_ = contextBuilder_.build(); + } + if (typeBuilder_ == null) { + result.type_ = type_; + } else { + result.type_ = typeBuilder_.build(); + } + if (itemListElementBuilder_ == null) { + result.itemListElement_ = itemListElement_; + } else { + result.itemListElement_ = itemListElementBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse) { + return mergeFrom((com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse other) { + if (other == com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse.getDefaultInstance()) + return this; + if (other.hasContext()) { + mergeContext(other.getContext()); + } + if (other.hasType()) { + mergeType(other.getType()); + } + if (other.hasItemListElement()) { + mergeItemListElement(other.getItemListElement()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getContextFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + input.readMessage(getTypeFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 18 + case 26: + { + input.readMessage(getItemListElementFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private com.google.protobuf.Value context_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + contextBuilder_; + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + public boolean hasContext() { + return contextBuilder_ != null || context_ != null; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + public com.google.protobuf.Value getContext() { + if (contextBuilder_ == null) { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } else { + return contextBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + context_ = value; + onChanged(); + } else { + contextBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder setContext(com.google.protobuf.Value.Builder builderForValue) { + if (contextBuilder_ == null) { + context_ = builderForValue.build(); + onChanged(); + } else { + contextBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder mergeContext(com.google.protobuf.Value value) { + if (contextBuilder_ == null) { + if (context_ != null) { + context_ = com.google.protobuf.Value.newBuilder(context_).mergeFrom(value).buildPartial(); + } else { + context_ = value; + } + onChanged(); + } else { + contextBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public Builder clearContext() { + if (contextBuilder_ == null) { + context_ = null; + onChanged(); + } else { + context_ = null; + contextBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.Value.Builder getContextBuilder() { + + onChanged(); + return getContextFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + public com.google.protobuf.ValueOrBuilder getContextOrBuilder() { + if (contextBuilder_ != null) { + return contextBuilder_.getMessageOrBuilder(); + } else { + return context_ == null ? com.google.protobuf.Value.getDefaultInstance() : context_; + } + } + /** + * + * + *
+     * The local context applicable for the response. See more details at
+     * http://www.w3.org/TR/json-ld/#context-definitions.
+     * 
+ * + * .google.protobuf.Value context = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getContextFieldBuilder() { + if (contextBuilder_ == null) { + contextBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>( + getContext(), getParentForChildren(), isClean()); + context_ = null; + } + return contextBuilder_; + } + + private com.google.protobuf.Value type_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + typeBuilder_; + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + public boolean hasType() { + return typeBuilder_ != null || type_ != null; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + public com.google.protobuf.Value getType() { + if (typeBuilder_ == null) { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } else { + return typeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + type_ = value; + onChanged(); + } else { + typeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder setType(com.google.protobuf.Value.Builder builderForValue) { + if (typeBuilder_ == null) { + type_ = builderForValue.build(); + onChanged(); + } else { + typeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder mergeType(com.google.protobuf.Value value) { + if (typeBuilder_ == null) { + if (type_ != null) { + type_ = com.google.protobuf.Value.newBuilder(type_).mergeFrom(value).buildPartial(); + } else { + type_ = value; + } + onChanged(); + } else { + typeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public Builder clearType() { + if (typeBuilder_ == null) { + type_ = null; + onChanged(); + } else { + type_ = null; + typeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.Value.Builder getTypeBuilder() { + + onChanged(); + return getTypeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + public com.google.protobuf.ValueOrBuilder getTypeOrBuilder() { + if (typeBuilder_ != null) { + return typeBuilder_.getMessageOrBuilder(); + } else { + return type_ == null ? com.google.protobuf.Value.getDefaultInstance() : type_; + } + } + /** + * + * + *
+     * The schema type of top-level JSON-LD object, e.g. ItemList.
+     * 
+ * + * .google.protobuf.Value type = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder> + getTypeFieldBuilder() { + if (typeBuilder_ == null) { + typeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Value, + com.google.protobuf.Value.Builder, + com.google.protobuf.ValueOrBuilder>(getType(), getParentForChildren(), isClean()); + type_ = null; + } + return typeBuilder_; + } + + private com.google.protobuf.ListValue itemListElement_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + itemListElementBuilder_; + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + public boolean hasItemListElement() { + return itemListElementBuilder_ != null || itemListElement_ != null; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + public com.google.protobuf.ListValue getItemListElement() { + if (itemListElementBuilder_ == null) { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } else { + return itemListElementBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + itemListElement_ = value; + onChanged(); + } else { + itemListElementBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder setItemListElement(com.google.protobuf.ListValue.Builder builderForValue) { + if (itemListElementBuilder_ == null) { + itemListElement_ = builderForValue.build(); + onChanged(); + } else { + itemListElementBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder mergeItemListElement(com.google.protobuf.ListValue value) { + if (itemListElementBuilder_ == null) { + if (itemListElement_ != null) { + itemListElement_ = + com.google.protobuf.ListValue.newBuilder(itemListElement_) + .mergeFrom(value) + .buildPartial(); + } else { + itemListElement_ = value; + } + onChanged(); + } else { + itemListElementBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public Builder clearItemListElement() { + if (itemListElementBuilder_ == null) { + itemListElement_ = null; + onChanged(); + } else { + itemListElement_ = null; + itemListElementBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValue.Builder getItemListElementBuilder() { + + onChanged(); + return getItemListElementFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + public com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder() { + if (itemListElementBuilder_ != null) { + return itemListElementBuilder_.getMessageOrBuilder(); + } else { + return itemListElement_ == null + ? com.google.protobuf.ListValue.getDefaultInstance() + : itemListElement_; + } + } + /** + * + * + *
+     * The item list of search results.
+     * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder> + getItemListElementFieldBuilder() { + if (itemListElementBuilder_ == null) { + itemListElementBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.ListValue, + com.google.protobuf.ListValue.Builder, + com.google.protobuf.ListValueOrBuilder>( + getItemListElement(), getParentForChildren(), isClean()); + itemListElement_ = null; + } + return itemListElementBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.enterpriseknowledgegraph.v1.SearchResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.enterpriseknowledgegraph.v1.SearchResponse) + private static final com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse(); + } + + public static com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SearchResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.enterpriseknowledgegraph.v1.SearchResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchResponseOrBuilder.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchResponseOrBuilder.java new file mode 100644 index 000000000000..caab209ed976 --- /dev/null +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/SearchResponseOrBuilder.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/enterpriseknowledgegraph/v1/service.proto + +package com.google.cloud.enterpriseknowledgegraph.v1; + +public interface SearchResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.enterpriseknowledgegraph.v1.SearchResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return Whether the context field is set. + */ + boolean hasContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + * + * @return The context. + */ + com.google.protobuf.Value getContext(); + /** + * + * + *
+   * The local context applicable for the response. See more details at
+   * http://www.w3.org/TR/json-ld/#context-definitions.
+   * 
+ * + * .google.protobuf.Value context = 1; + */ + com.google.protobuf.ValueOrBuilder getContextOrBuilder(); + + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return Whether the type field is set. + */ + boolean hasType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + * + * @return The type. + */ + com.google.protobuf.Value getType(); + /** + * + * + *
+   * The schema type of top-level JSON-LD object, e.g. ItemList.
+   * 
+ * + * .google.protobuf.Value type = 2; + */ + com.google.protobuf.ValueOrBuilder getTypeOrBuilder(); + + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return Whether the itemListElement field is set. + */ + boolean hasItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + * + * @return The itemListElement. + */ + com.google.protobuf.ListValue getItemListElement(); + /** + * + * + *
+   * The item list of search results.
+   * 
+ * + * .google.protobuf.ListValue item_list_element = 3; + */ + com.google.protobuf.ListValueOrBuilder getItemListElementOrBuilder(); +} diff --git a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/ServiceProto.java b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/ServiceProto.java index 8723850bc046..c9cc3c1d3b62 100644 --- a/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/ServiceProto.java +++ b/java-enterpriseknowledgegraph/proto-google-cloud-enterpriseknowledgegraph-v1/src/main/java/com/google/cloud/enterpriseknowledgegraph/v1/ServiceProto.java @@ -91,6 +91,38 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_enterpriseknowledgegraph_v1_EntityReconciliationJob_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_enterpriseknowledgegraph_v1_EntityReconciliationJob_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_LookupPublicKgResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_enterpriseknowledgegraph_v1_SearchPublicKgResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -109,132 +141,199 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "owledgegraph/v1/job_state.proto\032Agoogle/" + "cloud/enterpriseknowledgegraph/v1/operat" + "ion_metadata.proto\032\033google/protobuf/empt" - + "y.proto\032\037google/protobuf/timestamp.proto" - + "\032\027google/rpc/status.proto\"\266\003\n\013InputConfi" - + "g\022]\n\026bigquery_input_configs\030\001 \003(\0132=.goog" - + "le.cloud.enterpriseknowledgegraph.v1.Big" - + "QueryInputConfig\022U\n\013entity_type\030\002 \001(\0162@." + + "y.proto\032\034google/protobuf/struct.proto\032\037g" + + "oogle/protobuf/timestamp.proto\032\036google/p" + + "rotobuf/wrappers.proto\032\027google/rpc/statu" + + "s.proto\"\266\003\n\013InputConfig\022]\n\026bigquery_inpu" + + "t_configs\030\001 \003(\0132=.google.cloud.enterpris" + + "eknowledgegraph.v1.BigQueryInputConfig\022U" + + "\n\013entity_type\030\002 \001(\0162@.google.cloud.enter" + + "priseknowledgegraph.v1.InputConfig.Entit" + + "yType\022M\n\036previous_result_bigquery_table\030" + + "\003 \001(\tB%\340A\001\372A\037\n\035bigquery.googleapis.com/T" + + "able\"\241\001\n\nEntityType\022\033\n\027ENTITY_TYPE_UNSPE" + + "CIFIED\020\000\022\016\n\006PEOPLE\020\001\032\002\010\001\022\025\n\rESTABLISHMEN" + + "T\020\002\032\002\010\001\022\020\n\010PROPERTY\020\003\032\002\010\001\022\013\n\007PRODUCT\020\004\022\020" + + "\n\014ORGANIZATION\020\005\022\022\n\016LOCAL_BUSINESS\020\006\022\n\n\006" + + "PERSON\020\007\"j\n\023BigQueryInputConfig\022=\n\016bigqu" + + "ery_table\030\001 \001(\tB%\340A\002\372A\037\n\035bigquery.google" + + "apis.com/Table\022\024\n\007gcs_uri\030\002 \001(\tB\003\340A\002\"N\n\014" + + "OutputConfig\022>\n\020bigquery_dataset\030\001 \001(\tB$" + + "\372A!\n\037bigquery.googleapis.com/Dataset\"\211\004\n" + + "\013ReconConfig\022j\n\033connected_components_con" + + "fig\030\001 \001(\0132C.google.cloud.enterpriseknowl" + + "edgegraph.v1.ConnectedComponentsConfigH\000" + + "\022h\n\032affinity_clustering_config\030\002 \001(\0132B.g" + + "oogle.cloud.enterpriseknowledgegraph.v1." + + "AffinityClusteringConfigH\000\022N\n\007options\030\003 " + + "\001(\0132=.google.cloud.enterpriseknowledgegr" + + "aph.v1.ReconConfig.Options\022W\n\014model_conf" + + "ig\030\004 \001(\0132A.google.cloud.enterpriseknowle" + + "dgegraph.v1.ReconConfig.ModelConfig\032.\n\007O" + + "ptions\022#\n\033enable_geocoding_separation\030d " + + "\001(\010\0326\n\013ModelConfig\022\022\n\nmodel_name\030\001 \001(\t\022\023" + + "\n\013version_tag\030\002 \001(\tB\023\n\021clustering_config" + + "\"5\n\031ConnectedComponentsConfig\022\030\n\020weight_" + + "threshold\030\001 \001(\002\";\n\030AffinityClusteringCon" + + "fig\022\037\n\027compression_round_count\030\001 \001(\003\"u\n\027" + + "DeleteOperationMetadata\022Z\n\017common_metada" + + "ta\030\001 \001(\0132A.google.cloud.enterpriseknowle" + + "dgegraph.v1.CommonOperationMetadata\"\352\001\n$" + + "CreateEntityReconciliationJobRequest\022W\n\006" + + "parent\030\001 \001(\tBG\340A\002\372AA\022?enterpriseknowledg" + + "egraph.googleapis.com/EntityReconciliati" + + "onJob\022i\n\031entity_reconciliation_job\030\002 \001(\013" + + "2A.google.cloud.enterpriseknowledgegraph" + + ".v1.EntityReconciliationJobB\003\340A\002\"z\n!GetE" + + "ntityReconciliationJobRequest\022U\n\004name\030\001 " + + "\001(\tBG\340A\002\372AA\n?enterpriseknowledgegraph.go" + + "ogleapis.com/EntityReconciliationJob\"\265\001\n" + + "#ListEntityReconciliationJobsRequest\022W\n\006" + + "parent\030\001 \001(\tBG\340A\002\372AA\022?enterpriseknowledg" + + "egraph.googleapis.com/EntityReconciliati" + + "onJob\022\016\n\006filter\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005" + + "\022\022\n\npage_token\030\004 \001(\t\"\246\001\n$ListEntityRecon" + + "ciliationJobsResponse\022e\n\032entity_reconcil" + + "iation_jobs\030\001 \003(\0132A.google.cloud.enterpr" + + "iseknowledgegraph.v1.EntityReconciliatio" + + "nJob\022\027\n\017next_page_token\030\002 \001(\t\"}\n$CancelE" + + "ntityReconciliationJobRequest\022U\n\004name\030\001 " + + "\001(\tBG\340A\002\372AA\n?enterpriseknowledgegraph.go" + + "ogleapis.com/EntityReconciliationJob\"}\n$" + + "DeleteEntityReconciliationJobRequest\022U\n\004" + + "name\030\001 \001(\tBG\340A\002\372AA\n?enterpriseknowledgeg" + + "raph.googleapis.com/EntityReconciliation" + + "Job\"\331\005\n\027EntityReconciliationJob\022\021\n\004name\030" + + "\001 \001(\tB\003\340A\003\022P\n\014input_config\030\002 \001(\01325.googl" + + "e.cloud.enterpriseknowledgegraph.v1.Inpu" + + "tConfigB\003\340A\002\022R\n\routput_config\030\003 \001(\01326.go" + + "ogle.cloud.enterpriseknowledgegraph.v1.O" + + "utputConfigB\003\340A\002\022F\n\005state\030\004 \001(\01622.google" + + ".cloud.enterpriseknowledgegraph.v1.JobSt" + + "ateB\003\340A\003\022&\n\005error\030\005 \001(\0132\022.google.rpc.Sta" + + "tusB\003\340A\003\0224\n\013create_time\030\006 \001(\0132\032.google.p" + + "rotobuf.TimestampB\003\340A\003\0221\n\010end_time\030\007 \001(\013" + + "2\032.google.protobuf.TimestampB\003\340A\003\0224\n\013upd" + + "ate_time\030\010 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\022P\n\014recon_config\030\t \001(\01325.google.c" + + "loud.enterpriseknowledgegraph.v1.ReconCo" + + "nfigB\003\340A\001:\243\001\352A\237\001\n?enterpriseknowledgegra" + + "ph.googleapis.com/EntityReconciliationJo" + + "b\022\\projects/{project}/locations/{locatio" + + "n}/entityReconciliationJobs/{entity_reco" + + "nciliation_job}\"\217\001\n\rLookupRequest\022Y\n\006par" + + "ent\030\001 \001(\tBI\340A\002\372AC\022Aenterpriseknowledgegr" + + "aph.googleapis.com/CloudKnowledgeGraphEn" + + "tity\022\020\n\003ids\030\002 \003(\tB\003\340A\002\022\021\n\tlanguages\030\003 \003(" + + "\t\"\226\001\n\016LookupResponse\022\'\n\007context\030\001 \001(\0132\026." + + "google.protobuf.Value\022$\n\004type\030\002 \001(\0132\026.go" + + "ogle.protobuf.Value\0225\n\021item_list_element" + + "\030\003 \001(\0132\032.google.protobuf.ListValue\"\314\001\n\rS" + + "earchRequest\022Y\n\006parent\030\001 \001(\tBI\340A\002\372AC\022Aen" + + "terpriseknowledgegraph.googleapis.com/Cl" + + "oudKnowledgeGraphEntity\022\022\n\005query\030\002 \001(\tB\003" + + "\340A\002\022\021\n\tlanguages\030\003 \003(\t\022\r\n\005types\030\004 \003(\t\022*\n" + + "\005limit\030\006 \001(\0132\033.google.protobuf.Int32Valu" + + "e\"\226\001\n\016SearchResponse\022\'\n\007context\030\001 \001(\0132\026." + + "google.protobuf.Value\022$\n\004type\030\002 \001(\0132\026.go" + + "ogle.protobuf.Value\0225\n\021item_list_element" + + "\030\003 \001(\0132\032.google.protobuf.ListValue\"\230\001\n\025L" + + "ookupPublicKgRequest\022Z\n\006parent\030\001 \001(\tBJ\340A" + + "\002\372AD\022Benterpriseknowledgegraph.googleapi" + + "s.com/PublicKnowledgeGraphEntity\022\020\n\003ids\030" + + "\002 \003(\tB\003\340A\002\022\021\n\tlanguages\030\003 \003(\t\"\236\001\n\026Lookup" + + "PublicKgResponse\022\'\n\007context\030\001 \001(\0132\026.goog" + + "le.protobuf.Value\022$\n\004type\030\002 \001(\0132\026.google" + + ".protobuf.Value\0225\n\021item_list_element\030\003 \001" + + "(\0132\032.google.protobuf.ListValue\"\325\001\n\025Searc" + + "hPublicKgRequest\022Z\n\006parent\030\001 \001(\tBJ\340A\002\372AD" + + "\022Benterpriseknowledgegraph.googleapis.co" + + "m/PublicKnowledgeGraphEntity\022\022\n\005query\030\002 " + + "\001(\tB\003\340A\002\022\021\n\tlanguages\030\003 \003(\t\022\r\n\005types\030\004 \003" + + "(\t\022*\n\005limit\030\006 \001(\0132\033.google.protobuf.Int3" + + "2Value\"\236\001\n\026SearchPublicKgResponse\022\'\n\007con" + + "text\030\001 \001(\0132\026.google.protobuf.Value\022$\n\004ty" + + "pe\030\002 \001(\0132\026.google.protobuf.Value\0225\n\021item" + + "_list_element\030\003 \001(\0132\032.google.protobuf.Li" + + "stValue2\235\022\n\037EnterpriseKnowledgeGraphServ" + + "ice\022\267\002\n\035CreateEntityReconciliationJob\022N." + "google.cloud.enterpriseknowledgegraph.v1" - + ".InputConfig.EntityType\022M\n\036previous_resu" - + "lt_bigquery_table\030\003 \001(\tB%\340A\001\372A\037\n\035bigquer" - + "y.googleapis.com/Table\"\241\001\n\nEntityType\022\033\n" - + "\027ENTITY_TYPE_UNSPECIFIED\020\000\022\016\n\006PEOPLE\020\001\032\002" - + "\010\001\022\025\n\rESTABLISHMENT\020\002\032\002\010\001\022\020\n\010PROPERTY\020\003\032" - + "\002\010\001\022\013\n\007PRODUCT\020\004\022\020\n\014ORGANIZATION\020\005\022\022\n\016LO" - + "CAL_BUSINESS\020\006\022\n\n\006PERSON\020\007\"j\n\023BigQueryIn" - + "putConfig\022=\n\016bigquery_table\030\001 \001(\tB%\340A\002\372A" - + "\037\n\035bigquery.googleapis.com/Table\022\024\n\007gcs_" - + "uri\030\002 \001(\tB\003\340A\002\"N\n\014OutputConfig\022>\n\020bigque" - + "ry_dataset\030\001 \001(\tB$\372A!\n\037bigquery.googleap" - + "is.com/Dataset\"\211\004\n\013ReconConfig\022j\n\033connec" - + "ted_components_config\030\001 \001(\0132C.google.clo" - + "ud.enterpriseknowledgegraph.v1.Connected" - + "ComponentsConfigH\000\022h\n\032affinity_clusterin" - + "g_config\030\002 \001(\0132B.google.cloud.enterprise" - + "knowledgegraph.v1.AffinityClusteringConf" - + "igH\000\022N\n\007options\030\003 \001(\0132=.google.cloud.ent" - + "erpriseknowledgegraph.v1.ReconConfig.Opt" - + "ions\022W\n\014model_config\030\004 \001(\0132A.google.clou" - + "d.enterpriseknowledgegraph.v1.ReconConfi" - + "g.ModelConfig\032.\n\007Options\022#\n\033enable_geoco" - + "ding_separation\030d \001(\010\0326\n\013ModelConfig\022\022\n\n" - + "model_name\030\001 \001(\t\022\023\n\013version_tag\030\002 \001(\tB\023\n" - + "\021clustering_config\"5\n\031ConnectedComponent" - + "sConfig\022\030\n\020weight_threshold\030\001 \001(\002\";\n\030Aff" - + "inityClusteringConfig\022\037\n\027compression_rou" - + "nd_count\030\001 \001(\003\"u\n\027DeleteOperationMetadat" - + "a\022Z\n\017common_metadata\030\001 \001(\0132A.google.clou" - + "d.enterpriseknowledgegraph.v1.CommonOper" - + "ationMetadata\"\352\001\n$CreateEntityReconcilia" - + "tionJobRequest\022W\n\006parent\030\001 \001(\tBG\340A\002\372AA\022?" - + "enterpriseknowledgegraph.googleapis.com/" - + "EntityReconciliationJob\022i\n\031entity_reconc" - + "iliation_job\030\002 \001(\0132A.google.cloud.enterp" - + "riseknowledgegraph.v1.EntityReconciliati" - + "onJobB\003\340A\002\"z\n!GetEntityReconciliationJob" - + "Request\022U\n\004name\030\001 \001(\tBG\340A\002\372AA\n?enterpris" - + "eknowledgegraph.googleapis.com/EntityRec" - + "onciliationJob\"\265\001\n#ListEntityReconciliat" - + "ionJobsRequest\022W\n\006parent\030\001 \001(\tBG\340A\002\372AA\022?" - + "enterpriseknowledgegraph.googleapis.com/" - + "EntityReconciliationJob\022\016\n\006filter\030\002 \001(\t\022" - + "\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\"\246" - + "\001\n$ListEntityReconciliationJobsResponse\022" - + "e\n\032entity_reconciliation_jobs\030\001 \003(\0132A.go" - + "ogle.cloud.enterpriseknowledgegraph.v1.E" - + "ntityReconciliationJob\022\027\n\017next_page_toke" - + "n\030\002 \001(\t\"}\n$CancelEntityReconciliationJob" - + "Request\022U\n\004name\030\001 \001(\tBG\340A\002\372AA\n?enterpris" - + "eknowledgegraph.googleapis.com/EntityRec" - + "onciliationJob\"}\n$DeleteEntityReconcilia" - + "tionJobRequest\022U\n\004name\030\001 \001(\tBG\340A\002\372AA\n?en" - + "terpriseknowledgegraph.googleapis.com/En" - + "tityReconciliationJob\"\331\005\n\027EntityReconcil" - + "iationJob\022\021\n\004name\030\001 \001(\tB\003\340A\003\022P\n\014input_co" - + "nfig\030\002 \001(\01325.google.cloud.enterpriseknow" - + "ledgegraph.v1.InputConfigB\003\340A\002\022R\n\routput" - + "_config\030\003 \001(\01326.google.cloud.enterprisek" - + "nowledgegraph.v1.OutputConfigB\003\340A\002\022F\n\005st" - + "ate\030\004 \001(\01622.google.cloud.enterpriseknowl" - + "edgegraph.v1.JobStateB\003\340A\003\022&\n\005error\030\005 \001(" - + "\0132\022.google.rpc.StatusB\003\340A\003\0224\n\013create_tim" - + "e\030\006 \001(\0132\032.google.protobuf.TimestampB\003\340A\003" - + "\0221\n\010end_time\030\007 \001(\0132\032.google.protobuf.Tim" - + "estampB\003\340A\003\0224\n\013update_time\030\010 \001(\0132\032.googl" - + "e.protobuf.TimestampB\003\340A\003\022P\n\014recon_confi" - + "g\030\t \001(\01325.google.cloud.enterpriseknowled" - + "gegraph.v1.ReconConfigB\003\340A\001:\243\001\352A\237\001\n?ente" - + "rpriseknowledgegraph.googleapis.com/Enti" - + "tyReconciliationJob\022\\projects/{project}/" - + "locations/{location}/entityReconciliatio" - + "nJobs/{entity_reconciliation_job}2\373\n\n\037En" - + "terpriseKnowledgeGraphService\022\267\002\n\035Create" - + "EntityReconciliationJob\022N.google.cloud.e" - + "nterpriseknowledgegraph.v1.CreateEntityR" - + "econciliationJobRequest\032A.google.cloud.e" - + "nterpriseknowledgegraph.v1.EntityReconci" - + "liationJob\"\202\001\202\323\344\223\002Y\"\022\022*\022\022*