Skip to content

Commit

Permalink
feat: [discoveryengine] add data store, engine and site search engine…
Browse files Browse the repository at this point in the history
… services (#10350)

* feat: add data store, engine and site search engine services
feat: support search summarization with citations and references
feat: add suggestion deny list import/purge APIs
feat: add engine support for multi-turn search and search APIs
docs: keep the API doc up-to-date with recent changes

PiperOrigin-RevId: 605218577

Source-Link: googleapis/googleapis@565c340

Source-Link: https://github.com/googleapis/googleapis-gen/commit/58fd8ac1d8582a698eac2f184ecec6a68497b545
Copy-Tag: eyJwIjoiamF2YS1kaXNjb3ZlcnllbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6IjU4ZmQ4YWMxZDg1ODJhNjk4ZWFjMmYxODRlY2VjNmE2ODQ5N2I1NDUifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Feb 9, 2024
1 parent 8e0fb1b commit 3bf2de6
Show file tree
Hide file tree
Showing 394 changed files with 144,788 additions and 1,409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@

import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.discoveryengine.v1beta.stub.CompletionServiceStub;
import com.google.cloud.discoveryengine.v1beta.stub.CompletionServiceStubSettings;
import com.google.longrunning.Operation;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
Expand Down Expand Up @@ -79,6 +83,36 @@
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> ImportSuggestionDenyListEntries</td>
* <td><p> Imports all [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a DataStore.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li><p> importSuggestionDenyListEntriesAsync(ImportSuggestionDenyListEntriesRequest request)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> importSuggestionDenyListEntriesOperationCallable()
* <li><p> importSuggestionDenyListEntriesCallable()
* </ul>
* </td>
* </tr>
* <tr>
* <td><p> PurgeSuggestionDenyListEntries</td>
* <td><p> Permanently deletes all [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a DataStore.</td>
* <td>
* <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
* <ul>
* <li><p> purgeSuggestionDenyListEntriesAsync(PurgeSuggestionDenyListEntriesRequest request)
* </ul>
* <p>Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.</p>
* <ul>
* <li><p> purgeSuggestionDenyListEntriesOperationCallable()
* <li><p> purgeSuggestionDenyListEntriesCallable()
* </ul>
* </td>
* </tr>
* </table>
*
* <p>See the individual methods for example code.
Expand Down Expand Up @@ -142,6 +176,8 @@
public class CompletionServiceClient implements BackgroundResource {
private final CompletionServiceSettings settings;
private final CompletionServiceStub stub;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;

/** Constructs an instance of CompletionServiceClient with default settings. */
public static final CompletionServiceClient create() throws IOException {
Expand Down Expand Up @@ -173,11 +209,17 @@ public static final CompletionServiceClient create(CompletionServiceStub stub) {
protected CompletionServiceClient(CompletionServiceSettings settings) throws IOException {
this.settings = settings;
this.stub = ((CompletionServiceStubSettings) settings.getStubSettings()).createStub();
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}

protected CompletionServiceClient(CompletionServiceStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}

public final CompletionServiceSettings getSettings() {
Expand All @@ -188,6 +230,23 @@ public CompletionServiceStub getStub() {
return stub;
}

/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}

/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
@BetaApi
public final OperationsClient getHttpJsonOperationsClient() {
return httpJsonOperationsClient;
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Completes the specified user input with keyword suggestions.
Expand Down Expand Up @@ -258,6 +317,228 @@ public final UnaryCallable<CompleteQueryRequest, CompleteQueryResponse> complete
return stub.completeQueryCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports all
* [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
* DataStore.
*
* <p>Sample code:
*
* <pre>{@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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
* ImportSuggestionDenyListEntriesRequest request =
* ImportSuggestionDenyListEntriesRequest.newBuilder()
* .setParent(
* DataStoreName.ofProjectLocationCollectionDataStoreName(
* "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
* .toString())
* .build();
* ImportSuggestionDenyListEntriesResponse response =
* completionServiceClient.importSuggestionDenyListEntriesAsync(request).get();
* }
* }</pre>
*
* @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 OperationFuture<
ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata>
importSuggestionDenyListEntriesAsync(ImportSuggestionDenyListEntriesRequest request) {
return importSuggestionDenyListEntriesOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports all
* [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
* DataStore.
*
* <p>Sample code:
*
* <pre>{@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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
* ImportSuggestionDenyListEntriesRequest request =
* ImportSuggestionDenyListEntriesRequest.newBuilder()
* .setParent(
* DataStoreName.ofProjectLocationCollectionDataStoreName(
* "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
* .toString())
* .build();
* OperationFuture<
* ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata>
* future =
* completionServiceClient
* .importSuggestionDenyListEntriesOperationCallable()
* .futureCall(request);
* // Do something.
* ImportSuggestionDenyListEntriesResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
ImportSuggestionDenyListEntriesRequest,
ImportSuggestionDenyListEntriesResponse,
ImportSuggestionDenyListEntriesMetadata>
importSuggestionDenyListEntriesOperationCallable() {
return stub.importSuggestionDenyListEntriesOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports all
* [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
* DataStore.
*
* <p>Sample code:
*
* <pre>{@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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
* ImportSuggestionDenyListEntriesRequest request =
* ImportSuggestionDenyListEntriesRequest.newBuilder()
* .setParent(
* DataStoreName.ofProjectLocationCollectionDataStoreName(
* "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
* .toString())
* .build();
* ApiFuture<Operation> future =
* completionServiceClient.importSuggestionDenyListEntriesCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<ImportSuggestionDenyListEntriesRequest, Operation>
importSuggestionDenyListEntriesCallable() {
return stub.importSuggestionDenyListEntriesCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Permanently deletes all
* [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
* DataStore.
*
* <p>Sample code:
*
* <pre>{@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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
* PurgeSuggestionDenyListEntriesRequest request =
* PurgeSuggestionDenyListEntriesRequest.newBuilder()
* .setParent(
* DataStoreName.ofProjectLocationCollectionDataStoreName(
* "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
* .toString())
* .build();
* PurgeSuggestionDenyListEntriesResponse response =
* completionServiceClient.purgeSuggestionDenyListEntriesAsync(request).get();
* }
* }</pre>
*
* @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 OperationFuture<
PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata>
purgeSuggestionDenyListEntriesAsync(PurgeSuggestionDenyListEntriesRequest request) {
return purgeSuggestionDenyListEntriesOperationCallable().futureCall(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Permanently deletes all
* [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
* DataStore.
*
* <p>Sample code:
*
* <pre>{@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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
* PurgeSuggestionDenyListEntriesRequest request =
* PurgeSuggestionDenyListEntriesRequest.newBuilder()
* .setParent(
* DataStoreName.ofProjectLocationCollectionDataStoreName(
* "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
* .toString())
* .build();
* OperationFuture<
* PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata>
* future =
* completionServiceClient
* .purgeSuggestionDenyListEntriesOperationCallable()
* .futureCall(request);
* // Do something.
* PurgeSuggestionDenyListEntriesResponse response = future.get();
* }
* }</pre>
*/
public final OperationCallable<
PurgeSuggestionDenyListEntriesRequest,
PurgeSuggestionDenyListEntriesResponse,
PurgeSuggestionDenyListEntriesMetadata>
purgeSuggestionDenyListEntriesOperationCallable() {
return stub.purgeSuggestionDenyListEntriesOperationCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Permanently deletes all
* [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
* DataStore.
*
* <p>Sample code:
*
* <pre>{@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 (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
* PurgeSuggestionDenyListEntriesRequest request =
* PurgeSuggestionDenyListEntriesRequest.newBuilder()
* .setParent(
* DataStoreName.ofProjectLocationCollectionDataStoreName(
* "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
* .toString())
* .build();
* ApiFuture<Operation> future =
* completionServiceClient.purgeSuggestionDenyListEntriesCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<PurgeSuggestionDenyListEntriesRequest, Operation>
purgeSuggestionDenyListEntriesCallable() {
return stub.purgeSuggestionDenyListEntriesCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Loading

0 comments on commit 3bf2de6

Please sign in to comment.