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