1818
1919import com .google .api .core .BetaApi ;
2020import com .google .api .gax .core .BackgroundResource ;
21+ import com .google .api .gax .httpjson .longrunning .OperationsClient ;
22+ import com .google .api .gax .longrunning .OperationFuture ;
23+ import com .google .api .gax .rpc .OperationCallable ;
2124import com .google .api .gax .rpc .UnaryCallable ;
2225import com .google .cloud .discoveryengine .v1beta .stub .CompletionServiceStub ;
2326import com .google .cloud .discoveryengine .v1beta .stub .CompletionServiceStubSettings ;
27+ import com .google .longrunning .Operation ;
2428import java .io .IOException ;
2529import java .util .concurrent .TimeUnit ;
2630import javax .annotation .Generated ;
7983 * </ul>
8084 * </td>
8185 * </tr>
86+ * <tr>
87+ * <td><p> ImportSuggestionDenyListEntries</td>
88+ * <td><p> Imports all [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a DataStore.</td>
89+ * <td>
90+ * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
91+ * <ul>
92+ * <li><p> importSuggestionDenyListEntriesAsync(ImportSuggestionDenyListEntriesRequest request)
93+ * </ul>
94+ * <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>
95+ * <ul>
96+ * <li><p> importSuggestionDenyListEntriesOperationCallable()
97+ * <li><p> importSuggestionDenyListEntriesCallable()
98+ * </ul>
99+ * </td>
100+ * </tr>
101+ * <tr>
102+ * <td><p> PurgeSuggestionDenyListEntries</td>
103+ * <td><p> Permanently deletes all [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a DataStore.</td>
104+ * <td>
105+ * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
106+ * <ul>
107+ * <li><p> purgeSuggestionDenyListEntriesAsync(PurgeSuggestionDenyListEntriesRequest request)
108+ * </ul>
109+ * <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>
110+ * <ul>
111+ * <li><p> purgeSuggestionDenyListEntriesOperationCallable()
112+ * <li><p> purgeSuggestionDenyListEntriesCallable()
113+ * </ul>
114+ * </td>
115+ * </tr>
82116 * </table>
83117 *
84118 * <p>See the individual methods for example code.
142176public class CompletionServiceClient implements BackgroundResource {
143177 private final CompletionServiceSettings settings ;
144178 private final CompletionServiceStub stub ;
179+ private final OperationsClient httpJsonOperationsClient ;
180+ private final com .google .longrunning .OperationsClient operationsClient ;
145181
146182 /** Constructs an instance of CompletionServiceClient with default settings. */
147183 public static final CompletionServiceClient create () throws IOException {
@@ -173,11 +209,17 @@ public static final CompletionServiceClient create(CompletionServiceStub stub) {
173209 protected CompletionServiceClient (CompletionServiceSettings settings ) throws IOException {
174210 this .settings = settings ;
175211 this .stub = ((CompletionServiceStubSettings ) settings .getStubSettings ()).createStub ();
212+ this .operationsClient =
213+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
214+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
176215 }
177216
178217 protected CompletionServiceClient (CompletionServiceStub stub ) {
179218 this .settings = null ;
180219 this .stub = stub ;
220+ this .operationsClient =
221+ com .google .longrunning .OperationsClient .create (this .stub .getOperationsStub ());
222+ this .httpJsonOperationsClient = OperationsClient .create (this .stub .getHttpJsonOperationsStub ());
181223 }
182224
183225 public final CompletionServiceSettings getSettings () {
@@ -188,6 +230,23 @@ public CompletionServiceStub getStub() {
188230 return stub ;
189231 }
190232
233+ /**
234+ * Returns the OperationsClient that can be used to query the status of a long-running operation
235+ * returned by another API method call.
236+ */
237+ public final com .google .longrunning .OperationsClient getOperationsClient () {
238+ return operationsClient ;
239+ }
240+
241+ /**
242+ * Returns the OperationsClient that can be used to query the status of a long-running operation
243+ * returned by another API method call.
244+ */
245+ @ BetaApi
246+ public final OperationsClient getHttpJsonOperationsClient () {
247+ return httpJsonOperationsClient ;
248+ }
249+
191250 // AUTO-GENERATED DOCUMENTATION AND METHOD.
192251 /**
193252 * Completes the specified user input with keyword suggestions.
@@ -258,6 +317,228 @@ public final UnaryCallable<CompleteQueryRequest, CompleteQueryResponse> complete
258317 return stub .completeQueryCallable ();
259318 }
260319
320+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
321+ /**
322+ * Imports all
323+ * [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
324+ * DataStore.
325+ *
326+ * <p>Sample code:
327+ *
328+ * <pre>{@code
329+ * // This snippet has been automatically generated and should be regarded as a code template only.
330+ * // It will require modifications to work:
331+ * // - It may require correct/in-range values for request initialization.
332+ * // - It may require specifying regional endpoints when creating the service client as shown in
333+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
334+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
335+ * ImportSuggestionDenyListEntriesRequest request =
336+ * ImportSuggestionDenyListEntriesRequest.newBuilder()
337+ * .setParent(
338+ * DataStoreName.ofProjectLocationCollectionDataStoreName(
339+ * "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
340+ * .toString())
341+ * .build();
342+ * ImportSuggestionDenyListEntriesResponse response =
343+ * completionServiceClient.importSuggestionDenyListEntriesAsync(request).get();
344+ * }
345+ * }</pre>
346+ *
347+ * @param request The request object containing all of the parameters for the API call.
348+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
349+ */
350+ public final OperationFuture <
351+ ImportSuggestionDenyListEntriesResponse , ImportSuggestionDenyListEntriesMetadata >
352+ importSuggestionDenyListEntriesAsync (ImportSuggestionDenyListEntriesRequest request ) {
353+ return importSuggestionDenyListEntriesOperationCallable ().futureCall (request );
354+ }
355+
356+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
357+ /**
358+ * Imports all
359+ * [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
360+ * DataStore.
361+ *
362+ * <p>Sample code:
363+ *
364+ * <pre>{@code
365+ * // This snippet has been automatically generated and should be regarded as a code template only.
366+ * // It will require modifications to work:
367+ * // - It may require correct/in-range values for request initialization.
368+ * // - It may require specifying regional endpoints when creating the service client as shown in
369+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
370+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
371+ * ImportSuggestionDenyListEntriesRequest request =
372+ * ImportSuggestionDenyListEntriesRequest.newBuilder()
373+ * .setParent(
374+ * DataStoreName.ofProjectLocationCollectionDataStoreName(
375+ * "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
376+ * .toString())
377+ * .build();
378+ * OperationFuture<
379+ * ImportSuggestionDenyListEntriesResponse, ImportSuggestionDenyListEntriesMetadata>
380+ * future =
381+ * completionServiceClient
382+ * .importSuggestionDenyListEntriesOperationCallable()
383+ * .futureCall(request);
384+ * // Do something.
385+ * ImportSuggestionDenyListEntriesResponse response = future.get();
386+ * }
387+ * }</pre>
388+ */
389+ public final OperationCallable <
390+ ImportSuggestionDenyListEntriesRequest ,
391+ ImportSuggestionDenyListEntriesResponse ,
392+ ImportSuggestionDenyListEntriesMetadata >
393+ importSuggestionDenyListEntriesOperationCallable () {
394+ return stub .importSuggestionDenyListEntriesOperationCallable ();
395+ }
396+
397+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
398+ /**
399+ * Imports all
400+ * [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
401+ * DataStore.
402+ *
403+ * <p>Sample code:
404+ *
405+ * <pre>{@code
406+ * // This snippet has been automatically generated and should be regarded as a code template only.
407+ * // It will require modifications to work:
408+ * // - It may require correct/in-range values for request initialization.
409+ * // - It may require specifying regional endpoints when creating the service client as shown in
410+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
411+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
412+ * ImportSuggestionDenyListEntriesRequest request =
413+ * ImportSuggestionDenyListEntriesRequest.newBuilder()
414+ * .setParent(
415+ * DataStoreName.ofProjectLocationCollectionDataStoreName(
416+ * "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
417+ * .toString())
418+ * .build();
419+ * ApiFuture<Operation> future =
420+ * completionServiceClient.importSuggestionDenyListEntriesCallable().futureCall(request);
421+ * // Do something.
422+ * Operation response = future.get();
423+ * }
424+ * }</pre>
425+ */
426+ public final UnaryCallable <ImportSuggestionDenyListEntriesRequest , Operation >
427+ importSuggestionDenyListEntriesCallable () {
428+ return stub .importSuggestionDenyListEntriesCallable ();
429+ }
430+
431+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
432+ /**
433+ * Permanently deletes all
434+ * [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
435+ * DataStore.
436+ *
437+ * <p>Sample code:
438+ *
439+ * <pre>{@code
440+ * // This snippet has been automatically generated and should be regarded as a code template only.
441+ * // It will require modifications to work:
442+ * // - It may require correct/in-range values for request initialization.
443+ * // - It may require specifying regional endpoints when creating the service client as shown in
444+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
445+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
446+ * PurgeSuggestionDenyListEntriesRequest request =
447+ * PurgeSuggestionDenyListEntriesRequest.newBuilder()
448+ * .setParent(
449+ * DataStoreName.ofProjectLocationCollectionDataStoreName(
450+ * "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
451+ * .toString())
452+ * .build();
453+ * PurgeSuggestionDenyListEntriesResponse response =
454+ * completionServiceClient.purgeSuggestionDenyListEntriesAsync(request).get();
455+ * }
456+ * }</pre>
457+ *
458+ * @param request The request object containing all of the parameters for the API call.
459+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
460+ */
461+ public final OperationFuture <
462+ PurgeSuggestionDenyListEntriesResponse , PurgeSuggestionDenyListEntriesMetadata >
463+ purgeSuggestionDenyListEntriesAsync (PurgeSuggestionDenyListEntriesRequest request ) {
464+ return purgeSuggestionDenyListEntriesOperationCallable ().futureCall (request );
465+ }
466+
467+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
468+ /**
469+ * Permanently deletes all
470+ * [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
471+ * DataStore.
472+ *
473+ * <p>Sample code:
474+ *
475+ * <pre>{@code
476+ * // This snippet has been automatically generated and should be regarded as a code template only.
477+ * // It will require modifications to work:
478+ * // - It may require correct/in-range values for request initialization.
479+ * // - It may require specifying regional endpoints when creating the service client as shown in
480+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
481+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
482+ * PurgeSuggestionDenyListEntriesRequest request =
483+ * PurgeSuggestionDenyListEntriesRequest.newBuilder()
484+ * .setParent(
485+ * DataStoreName.ofProjectLocationCollectionDataStoreName(
486+ * "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
487+ * .toString())
488+ * .build();
489+ * OperationFuture<
490+ * PurgeSuggestionDenyListEntriesResponse, PurgeSuggestionDenyListEntriesMetadata>
491+ * future =
492+ * completionServiceClient
493+ * .purgeSuggestionDenyListEntriesOperationCallable()
494+ * .futureCall(request);
495+ * // Do something.
496+ * PurgeSuggestionDenyListEntriesResponse response = future.get();
497+ * }
498+ * }</pre>
499+ */
500+ public final OperationCallable <
501+ PurgeSuggestionDenyListEntriesRequest ,
502+ PurgeSuggestionDenyListEntriesResponse ,
503+ PurgeSuggestionDenyListEntriesMetadata >
504+ purgeSuggestionDenyListEntriesOperationCallable () {
505+ return stub .purgeSuggestionDenyListEntriesOperationCallable ();
506+ }
507+
508+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
509+ /**
510+ * Permanently deletes all
511+ * [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry] for a
512+ * DataStore.
513+ *
514+ * <p>Sample code:
515+ *
516+ * <pre>{@code
517+ * // This snippet has been automatically generated and should be regarded as a code template only.
518+ * // It will require modifications to work:
519+ * // - It may require correct/in-range values for request initialization.
520+ * // - It may require specifying regional endpoints when creating the service client as shown in
521+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
522+ * try (CompletionServiceClient completionServiceClient = CompletionServiceClient.create()) {
523+ * PurgeSuggestionDenyListEntriesRequest request =
524+ * PurgeSuggestionDenyListEntriesRequest.newBuilder()
525+ * .setParent(
526+ * DataStoreName.ofProjectLocationCollectionDataStoreName(
527+ * "[PROJECT]", "[LOCATION]", "[COLLECTION]", "[DATA_STORE]")
528+ * .toString())
529+ * .build();
530+ * ApiFuture<Operation> future =
531+ * completionServiceClient.purgeSuggestionDenyListEntriesCallable().futureCall(request);
532+ * // Do something.
533+ * Operation response = future.get();
534+ * }
535+ * }</pre>
536+ */
537+ public final UnaryCallable <PurgeSuggestionDenyListEntriesRequest , Operation >
538+ purgeSuggestionDenyListEntriesCallable () {
539+ return stub .purgeSuggestionDenyListEntriesCallable ();
540+ }
541+
261542 @ Override
262543 public final void close () {
263544 stub .close ();
0 commit comments