2020import com .google .api .core .ApiFuture ;
2121import com .google .api .core .ApiFutures ;
2222import com .google .api .gax .core .BackgroundResource ;
23+ import com .google .api .gax .longrunning .OperationFuture ;
2324import com .google .api .gax .paging .AbstractFixedSizeCollection ;
2425import com .google .api .gax .paging .AbstractPage ;
2526import com .google .api .gax .paging .AbstractPagedListResponse ;
27+ import com .google .api .gax .rpc .OperationCallable ;
2628import com .google .api .gax .rpc .PageContext ;
2729import com .google .api .gax .rpc .ServerStreamingCallable ;
2830import com .google .api .gax .rpc .UnaryCallable ;
3840import com .google .iam .v1 .SetIamPolicyRequest ;
3941import com .google .iam .v1 .TestIamPermissionsRequest ;
4042import com .google .iam .v1 .TestIamPermissionsResponse ;
43+ import com .google .longrunning .Operation ;
44+ import com .google .longrunning .OperationsClient ;
4145import java .io .IOException ;
4246import java .util .List ;
4347import java .util .concurrent .TimeUnit ;
107111 * </td>
108112 * </tr>
109113 * <tr>
114+ * <td><p> AsyncQueryReasoningEngine</td>
115+ * <td><p> Async query using a reasoning engine.</td>
116+ * <td>
117+ * <p>Request object method variants only take one parameter, a request object, which must be constructed before the call.</p>
118+ * <ul>
119+ * <li><p> asyncQueryReasoningEngineAsync(AsyncQueryReasoningEngineRequest request)
120+ * </ul>
121+ * <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>
122+ * <ul>
123+ * <li><p> asyncQueryReasoningEngineOperationCallable()
124+ * <li><p> asyncQueryReasoningEngineCallable()
125+ * </ul>
126+ * </td>
127+ * </tr>
128+ * <tr>
110129 * <td><p> ListLocations</td>
111130 * <td><p> Lists information about the supported locations for this service.</td>
112131 * <td>
226245public class ReasoningEngineExecutionServiceClient implements BackgroundResource {
227246 private final ReasoningEngineExecutionServiceSettings settings ;
228247 private final ReasoningEngineExecutionServiceStub stub ;
248+ private final OperationsClient operationsClient ;
229249
230250 /** Constructs an instance of ReasoningEngineExecutionServiceClient with default settings. */
231251 public static final ReasoningEngineExecutionServiceClient create () throws IOException {
@@ -262,11 +282,13 @@ protected ReasoningEngineExecutionServiceClient(ReasoningEngineExecutionServiceS
262282 this .settings = settings ;
263283 this .stub =
264284 ((ReasoningEngineExecutionServiceStubSettings ) settings .getStubSettings ()).createStub ();
285+ this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
265286 }
266287
267288 protected ReasoningEngineExecutionServiceClient (ReasoningEngineExecutionServiceStub stub ) {
268289 this .settings = null ;
269290 this .stub = stub ;
291+ this .operationsClient = OperationsClient .create (this .stub .getOperationsStub ());
270292 }
271293
272294 public final ReasoningEngineExecutionServiceSettings getSettings () {
@@ -277,6 +299,14 @@ public ReasoningEngineExecutionServiceStub getStub() {
277299 return stub ;
278300 }
279301
302+ /**
303+ * Returns the OperationsClient that can be used to query the status of a long-running operation
304+ * returned by another API method call.
305+ */
306+ public final OperationsClient getOperationsClient () {
307+ return operationsClient ;
308+ }
309+
280310 // AUTO-GENERATED DOCUMENTATION AND METHOD.
281311 /**
282312 * Queries using a reasoning engine.
@@ -381,6 +411,118 @@ public final QueryReasoningEngineResponse queryReasoningEngine(
381411 return stub .streamQueryReasoningEngineCallable ();
382412 }
383413
414+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
415+ /**
416+ * Async query using a reasoning engine.
417+ *
418+ * <p>Sample code:
419+ *
420+ * <pre>{@code
421+ * // This snippet has been automatically generated and should be regarded as a code template only.
422+ * // It will require modifications to work:
423+ * // - It may require correct/in-range values for request initialization.
424+ * // - It may require specifying regional endpoints when creating the service client as shown in
425+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
426+ * try (ReasoningEngineExecutionServiceClient reasoningEngineExecutionServiceClient =
427+ * ReasoningEngineExecutionServiceClient.create()) {
428+ * AsyncQueryReasoningEngineRequest request =
429+ * AsyncQueryReasoningEngineRequest.newBuilder()
430+ * .setName(
431+ * ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
432+ * .toString())
433+ * .setInputGcsUri("inputGcsUri-665217217")
434+ * .setOutputGcsUri("outputGcsUri-489598154")
435+ * .build();
436+ * AsyncQueryReasoningEngineResponse response =
437+ * reasoningEngineExecutionServiceClient.asyncQueryReasoningEngineAsync(request).get();
438+ * }
439+ * }</pre>
440+ *
441+ * @param request The request object containing all of the parameters for the API call.
442+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
443+ */
444+ public final OperationFuture <
445+ AsyncQueryReasoningEngineResponse , AsyncQueryReasoningEngineOperationMetadata >
446+ asyncQueryReasoningEngineAsync (AsyncQueryReasoningEngineRequest request ) {
447+ return asyncQueryReasoningEngineOperationCallable ().futureCall (request );
448+ }
449+
450+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
451+ /**
452+ * Async query using a reasoning engine.
453+ *
454+ * <p>Sample code:
455+ *
456+ * <pre>{@code
457+ * // This snippet has been automatically generated and should be regarded as a code template only.
458+ * // It will require modifications to work:
459+ * // - It may require correct/in-range values for request initialization.
460+ * // - It may require specifying regional endpoints when creating the service client as shown in
461+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
462+ * try (ReasoningEngineExecutionServiceClient reasoningEngineExecutionServiceClient =
463+ * ReasoningEngineExecutionServiceClient.create()) {
464+ * AsyncQueryReasoningEngineRequest request =
465+ * AsyncQueryReasoningEngineRequest.newBuilder()
466+ * .setName(
467+ * ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
468+ * .toString())
469+ * .setInputGcsUri("inputGcsUri-665217217")
470+ * .setOutputGcsUri("outputGcsUri-489598154")
471+ * .build();
472+ * OperationFuture<AsyncQueryReasoningEngineResponse, AsyncQueryReasoningEngineOperationMetadata>
473+ * future =
474+ * reasoningEngineExecutionServiceClient
475+ * .asyncQueryReasoningEngineOperationCallable()
476+ * .futureCall(request);
477+ * // Do something.
478+ * AsyncQueryReasoningEngineResponse response = future.get();
479+ * }
480+ * }</pre>
481+ */
482+ public final OperationCallable <
483+ AsyncQueryReasoningEngineRequest ,
484+ AsyncQueryReasoningEngineResponse ,
485+ AsyncQueryReasoningEngineOperationMetadata >
486+ asyncQueryReasoningEngineOperationCallable () {
487+ return stub .asyncQueryReasoningEngineOperationCallable ();
488+ }
489+
490+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
491+ /**
492+ * Async query using a reasoning engine.
493+ *
494+ * <p>Sample code:
495+ *
496+ * <pre>{@code
497+ * // This snippet has been automatically generated and should be regarded as a code template only.
498+ * // It will require modifications to work:
499+ * // - It may require correct/in-range values for request initialization.
500+ * // - It may require specifying regional endpoints when creating the service client as shown in
501+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
502+ * try (ReasoningEngineExecutionServiceClient reasoningEngineExecutionServiceClient =
503+ * ReasoningEngineExecutionServiceClient.create()) {
504+ * AsyncQueryReasoningEngineRequest request =
505+ * AsyncQueryReasoningEngineRequest.newBuilder()
506+ * .setName(
507+ * ReasoningEngineName.of("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]")
508+ * .toString())
509+ * .setInputGcsUri("inputGcsUri-665217217")
510+ * .setOutputGcsUri("outputGcsUri-489598154")
511+ * .build();
512+ * ApiFuture<Operation> future =
513+ * reasoningEngineExecutionServiceClient
514+ * .asyncQueryReasoningEngineCallable()
515+ * .futureCall(request);
516+ * // Do something.
517+ * Operation response = future.get();
518+ * }
519+ * }</pre>
520+ */
521+ public final UnaryCallable <AsyncQueryReasoningEngineRequest , Operation >
522+ asyncQueryReasoningEngineCallable () {
523+ return stub .asyncQueryReasoningEngineCallable ();
524+ }
525+
384526 // AUTO-GENERATED DOCUMENTATION AND METHOD.
385527 /**
386528 * Lists information about the supported locations for this service.
0 commit comments