• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.google.cloud.dialogflow.cx.v3.stub;
18 
19 import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListFlowsPagedResponse;
20 import static com.google.cloud.dialogflow.cx.v3.FlowsClient.ListLocationsPagedResponse;
21 
22 import com.google.api.gax.core.BackgroundResource;
23 import com.google.api.gax.core.BackgroundResourceAggregation;
24 import com.google.api.gax.grpc.GrpcCallSettings;
25 import com.google.api.gax.grpc.GrpcStubCallableFactory;
26 import com.google.api.gax.rpc.ClientContext;
27 import com.google.api.gax.rpc.OperationCallable;
28 import com.google.api.gax.rpc.UnaryCallable;
29 import com.google.cloud.dialogflow.cx.v3.CreateFlowRequest;
30 import com.google.cloud.dialogflow.cx.v3.DeleteFlowRequest;
31 import com.google.cloud.dialogflow.cx.v3.ExportFlowRequest;
32 import com.google.cloud.dialogflow.cx.v3.ExportFlowResponse;
33 import com.google.cloud.dialogflow.cx.v3.Flow;
34 import com.google.cloud.dialogflow.cx.v3.FlowValidationResult;
35 import com.google.cloud.dialogflow.cx.v3.GetFlowRequest;
36 import com.google.cloud.dialogflow.cx.v3.GetFlowValidationResultRequest;
37 import com.google.cloud.dialogflow.cx.v3.ImportFlowRequest;
38 import com.google.cloud.dialogflow.cx.v3.ImportFlowResponse;
39 import com.google.cloud.dialogflow.cx.v3.ListFlowsRequest;
40 import com.google.cloud.dialogflow.cx.v3.ListFlowsResponse;
41 import com.google.cloud.dialogflow.cx.v3.TrainFlowRequest;
42 import com.google.cloud.dialogflow.cx.v3.UpdateFlowRequest;
43 import com.google.cloud.dialogflow.cx.v3.ValidateFlowRequest;
44 import com.google.cloud.location.GetLocationRequest;
45 import com.google.cloud.location.ListLocationsRequest;
46 import com.google.cloud.location.ListLocationsResponse;
47 import com.google.cloud.location.Location;
48 import com.google.common.collect.ImmutableMap;
49 import com.google.longrunning.Operation;
50 import com.google.longrunning.stub.GrpcOperationsStub;
51 import com.google.protobuf.Empty;
52 import com.google.protobuf.Struct;
53 import io.grpc.MethodDescriptor;
54 import io.grpc.protobuf.ProtoUtils;
55 import java.io.IOException;
56 import java.util.concurrent.TimeUnit;
57 import javax.annotation.Generated;
58 
59 // AUTO-GENERATED DOCUMENTATION AND CLASS.
60 /**
61  * gRPC stub implementation for the Flows service API.
62  *
63  * <p>This class is for advanced usage and reflects the underlying API directly.
64  */
65 @Generated("by gapic-generator-java")
66 public class GrpcFlowsStub extends FlowsStub {
67   private static final MethodDescriptor<CreateFlowRequest, Flow> createFlowMethodDescriptor =
68       MethodDescriptor.<CreateFlowRequest, Flow>newBuilder()
69           .setType(MethodDescriptor.MethodType.UNARY)
70           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/CreateFlow")
71           .setRequestMarshaller(ProtoUtils.marshaller(CreateFlowRequest.getDefaultInstance()))
72           .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance()))
73           .build();
74 
75   private static final MethodDescriptor<DeleteFlowRequest, Empty> deleteFlowMethodDescriptor =
76       MethodDescriptor.<DeleteFlowRequest, Empty>newBuilder()
77           .setType(MethodDescriptor.MethodType.UNARY)
78           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/DeleteFlow")
79           .setRequestMarshaller(ProtoUtils.marshaller(DeleteFlowRequest.getDefaultInstance()))
80           .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
81           .build();
82 
83   private static final MethodDescriptor<ListFlowsRequest, ListFlowsResponse>
84       listFlowsMethodDescriptor =
85           MethodDescriptor.<ListFlowsRequest, ListFlowsResponse>newBuilder()
86               .setType(MethodDescriptor.MethodType.UNARY)
87               .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/ListFlows")
88               .setRequestMarshaller(ProtoUtils.marshaller(ListFlowsRequest.getDefaultInstance()))
89               .setResponseMarshaller(ProtoUtils.marshaller(ListFlowsResponse.getDefaultInstance()))
90               .build();
91 
92   private static final MethodDescriptor<GetFlowRequest, Flow> getFlowMethodDescriptor =
93       MethodDescriptor.<GetFlowRequest, Flow>newBuilder()
94           .setType(MethodDescriptor.MethodType.UNARY)
95           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/GetFlow")
96           .setRequestMarshaller(ProtoUtils.marshaller(GetFlowRequest.getDefaultInstance()))
97           .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance()))
98           .build();
99 
100   private static final MethodDescriptor<UpdateFlowRequest, Flow> updateFlowMethodDescriptor =
101       MethodDescriptor.<UpdateFlowRequest, Flow>newBuilder()
102           .setType(MethodDescriptor.MethodType.UNARY)
103           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/UpdateFlow")
104           .setRequestMarshaller(ProtoUtils.marshaller(UpdateFlowRequest.getDefaultInstance()))
105           .setResponseMarshaller(ProtoUtils.marshaller(Flow.getDefaultInstance()))
106           .build();
107 
108   private static final MethodDescriptor<TrainFlowRequest, Operation> trainFlowMethodDescriptor =
109       MethodDescriptor.<TrainFlowRequest, Operation>newBuilder()
110           .setType(MethodDescriptor.MethodType.UNARY)
111           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/TrainFlow")
112           .setRequestMarshaller(ProtoUtils.marshaller(TrainFlowRequest.getDefaultInstance()))
113           .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
114           .build();
115 
116   private static final MethodDescriptor<ValidateFlowRequest, FlowValidationResult>
117       validateFlowMethodDescriptor =
118           MethodDescriptor.<ValidateFlowRequest, FlowValidationResult>newBuilder()
119               .setType(MethodDescriptor.MethodType.UNARY)
120               .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/ValidateFlow")
121               .setRequestMarshaller(ProtoUtils.marshaller(ValidateFlowRequest.getDefaultInstance()))
122               .setResponseMarshaller(
123                   ProtoUtils.marshaller(FlowValidationResult.getDefaultInstance()))
124               .build();
125 
126   private static final MethodDescriptor<GetFlowValidationResultRequest, FlowValidationResult>
127       getFlowValidationResultMethodDescriptor =
128           MethodDescriptor.<GetFlowValidationResultRequest, FlowValidationResult>newBuilder()
129               .setType(MethodDescriptor.MethodType.UNARY)
130               .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/GetFlowValidationResult")
131               .setRequestMarshaller(
132                   ProtoUtils.marshaller(GetFlowValidationResultRequest.getDefaultInstance()))
133               .setResponseMarshaller(
134                   ProtoUtils.marshaller(FlowValidationResult.getDefaultInstance()))
135               .build();
136 
137   private static final MethodDescriptor<ImportFlowRequest, Operation> importFlowMethodDescriptor =
138       MethodDescriptor.<ImportFlowRequest, Operation>newBuilder()
139           .setType(MethodDescriptor.MethodType.UNARY)
140           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/ImportFlow")
141           .setRequestMarshaller(ProtoUtils.marshaller(ImportFlowRequest.getDefaultInstance()))
142           .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
143           .build();
144 
145   private static final MethodDescriptor<ExportFlowRequest, Operation> exportFlowMethodDescriptor =
146       MethodDescriptor.<ExportFlowRequest, Operation>newBuilder()
147           .setType(MethodDescriptor.MethodType.UNARY)
148           .setFullMethodName("google.cloud.dialogflow.cx.v3.Flows/ExportFlow")
149           .setRequestMarshaller(ProtoUtils.marshaller(ExportFlowRequest.getDefaultInstance()))
150           .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
151           .build();
152 
153   private static final MethodDescriptor<ListLocationsRequest, ListLocationsResponse>
154       listLocationsMethodDescriptor =
155           MethodDescriptor.<ListLocationsRequest, ListLocationsResponse>newBuilder()
156               .setType(MethodDescriptor.MethodType.UNARY)
157               .setFullMethodName("google.cloud.location.Locations/ListLocations")
158               .setRequestMarshaller(
159                   ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
160               .setResponseMarshaller(
161                   ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
162               .build();
163 
164   private static final MethodDescriptor<GetLocationRequest, Location> getLocationMethodDescriptor =
165       MethodDescriptor.<GetLocationRequest, Location>newBuilder()
166           .setType(MethodDescriptor.MethodType.UNARY)
167           .setFullMethodName("google.cloud.location.Locations/GetLocation")
168           .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
169           .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
170           .build();
171 
172   private final UnaryCallable<CreateFlowRequest, Flow> createFlowCallable;
173   private final UnaryCallable<DeleteFlowRequest, Empty> deleteFlowCallable;
174   private final UnaryCallable<ListFlowsRequest, ListFlowsResponse> listFlowsCallable;
175   private final UnaryCallable<ListFlowsRequest, ListFlowsPagedResponse> listFlowsPagedCallable;
176   private final UnaryCallable<GetFlowRequest, Flow> getFlowCallable;
177   private final UnaryCallable<UpdateFlowRequest, Flow> updateFlowCallable;
178   private final UnaryCallable<TrainFlowRequest, Operation> trainFlowCallable;
179   private final OperationCallable<TrainFlowRequest, Empty, Struct> trainFlowOperationCallable;
180   private final UnaryCallable<ValidateFlowRequest, FlowValidationResult> validateFlowCallable;
181   private final UnaryCallable<GetFlowValidationResultRequest, FlowValidationResult>
182       getFlowValidationResultCallable;
183   private final UnaryCallable<ImportFlowRequest, Operation> importFlowCallable;
184   private final OperationCallable<ImportFlowRequest, ImportFlowResponse, Struct>
185       importFlowOperationCallable;
186   private final UnaryCallable<ExportFlowRequest, Operation> exportFlowCallable;
187   private final OperationCallable<ExportFlowRequest, ExportFlowResponse, Struct>
188       exportFlowOperationCallable;
189   private final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable;
190   private final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
191       listLocationsPagedCallable;
192   private final UnaryCallable<GetLocationRequest, Location> getLocationCallable;
193 
194   private final BackgroundResource backgroundResources;
195   private final GrpcOperationsStub operationsStub;
196   private final GrpcStubCallableFactory callableFactory;
197 
create(FlowsStubSettings settings)198   public static final GrpcFlowsStub create(FlowsStubSettings settings) throws IOException {
199     return new GrpcFlowsStub(settings, ClientContext.create(settings));
200   }
201 
create(ClientContext clientContext)202   public static final GrpcFlowsStub create(ClientContext clientContext) throws IOException {
203     return new GrpcFlowsStub(FlowsStubSettings.newBuilder().build(), clientContext);
204   }
205 
create( ClientContext clientContext, GrpcStubCallableFactory callableFactory)206   public static final GrpcFlowsStub create(
207       ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
208     return new GrpcFlowsStub(
209         FlowsStubSettings.newBuilder().build(), clientContext, callableFactory);
210   }
211 
212   /**
213    * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it
214    * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
215    */
GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext)216   protected GrpcFlowsStub(FlowsStubSettings settings, ClientContext clientContext)
217       throws IOException {
218     this(settings, clientContext, new GrpcFlowsCallableFactory());
219   }
220 
221   /**
222    * Constructs an instance of GrpcFlowsStub, using the given settings. This is protected so that it
223    * is easy to make a subclass, but otherwise, the static factory methods should be preferred.
224    */
GrpcFlowsStub( FlowsStubSettings settings, ClientContext clientContext, GrpcStubCallableFactory callableFactory)225   protected GrpcFlowsStub(
226       FlowsStubSettings settings,
227       ClientContext clientContext,
228       GrpcStubCallableFactory callableFactory)
229       throws IOException {
230     this.callableFactory = callableFactory;
231     this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
232 
233     GrpcCallSettings<CreateFlowRequest, Flow> createFlowTransportSettings =
234         GrpcCallSettings.<CreateFlowRequest, Flow>newBuilder()
235             .setMethodDescriptor(createFlowMethodDescriptor)
236             .setParamsExtractor(
237                 request -> {
238                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
239                   params.put("parent", String.valueOf(request.getParent()));
240                   return params.build();
241                 })
242             .build();
243     GrpcCallSettings<DeleteFlowRequest, Empty> deleteFlowTransportSettings =
244         GrpcCallSettings.<DeleteFlowRequest, Empty>newBuilder()
245             .setMethodDescriptor(deleteFlowMethodDescriptor)
246             .setParamsExtractor(
247                 request -> {
248                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
249                   params.put("name", String.valueOf(request.getName()));
250                   return params.build();
251                 })
252             .build();
253     GrpcCallSettings<ListFlowsRequest, ListFlowsResponse> listFlowsTransportSettings =
254         GrpcCallSettings.<ListFlowsRequest, ListFlowsResponse>newBuilder()
255             .setMethodDescriptor(listFlowsMethodDescriptor)
256             .setParamsExtractor(
257                 request -> {
258                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
259                   params.put("parent", String.valueOf(request.getParent()));
260                   return params.build();
261                 })
262             .build();
263     GrpcCallSettings<GetFlowRequest, Flow> getFlowTransportSettings =
264         GrpcCallSettings.<GetFlowRequest, Flow>newBuilder()
265             .setMethodDescriptor(getFlowMethodDescriptor)
266             .setParamsExtractor(
267                 request -> {
268                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
269                   params.put("name", String.valueOf(request.getName()));
270                   return params.build();
271                 })
272             .build();
273     GrpcCallSettings<UpdateFlowRequest, Flow> updateFlowTransportSettings =
274         GrpcCallSettings.<UpdateFlowRequest, Flow>newBuilder()
275             .setMethodDescriptor(updateFlowMethodDescriptor)
276             .setParamsExtractor(
277                 request -> {
278                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
279                   params.put("flow.name", String.valueOf(request.getFlow().getName()));
280                   return params.build();
281                 })
282             .build();
283     GrpcCallSettings<TrainFlowRequest, Operation> trainFlowTransportSettings =
284         GrpcCallSettings.<TrainFlowRequest, Operation>newBuilder()
285             .setMethodDescriptor(trainFlowMethodDescriptor)
286             .setParamsExtractor(
287                 request -> {
288                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
289                   params.put("name", String.valueOf(request.getName()));
290                   return params.build();
291                 })
292             .build();
293     GrpcCallSettings<ValidateFlowRequest, FlowValidationResult> validateFlowTransportSettings =
294         GrpcCallSettings.<ValidateFlowRequest, FlowValidationResult>newBuilder()
295             .setMethodDescriptor(validateFlowMethodDescriptor)
296             .setParamsExtractor(
297                 request -> {
298                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
299                   params.put("name", String.valueOf(request.getName()));
300                   return params.build();
301                 })
302             .build();
303     GrpcCallSettings<GetFlowValidationResultRequest, FlowValidationResult>
304         getFlowValidationResultTransportSettings =
305             GrpcCallSettings.<GetFlowValidationResultRequest, FlowValidationResult>newBuilder()
306                 .setMethodDescriptor(getFlowValidationResultMethodDescriptor)
307                 .setParamsExtractor(
308                     request -> {
309                       ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
310                       params.put("name", String.valueOf(request.getName()));
311                       return params.build();
312                     })
313                 .build();
314     GrpcCallSettings<ImportFlowRequest, Operation> importFlowTransportSettings =
315         GrpcCallSettings.<ImportFlowRequest, Operation>newBuilder()
316             .setMethodDescriptor(importFlowMethodDescriptor)
317             .setParamsExtractor(
318                 request -> {
319                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
320                   params.put("parent", String.valueOf(request.getParent()));
321                   return params.build();
322                 })
323             .build();
324     GrpcCallSettings<ExportFlowRequest, Operation> exportFlowTransportSettings =
325         GrpcCallSettings.<ExportFlowRequest, Operation>newBuilder()
326             .setMethodDescriptor(exportFlowMethodDescriptor)
327             .setParamsExtractor(
328                 request -> {
329                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
330                   params.put("name", String.valueOf(request.getName()));
331                   return params.build();
332                 })
333             .build();
334     GrpcCallSettings<ListLocationsRequest, ListLocationsResponse> listLocationsTransportSettings =
335         GrpcCallSettings.<ListLocationsRequest, ListLocationsResponse>newBuilder()
336             .setMethodDescriptor(listLocationsMethodDescriptor)
337             .setParamsExtractor(
338                 request -> {
339                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
340                   params.put("name", String.valueOf(request.getName()));
341                   return params.build();
342                 })
343             .build();
344     GrpcCallSettings<GetLocationRequest, Location> getLocationTransportSettings =
345         GrpcCallSettings.<GetLocationRequest, Location>newBuilder()
346             .setMethodDescriptor(getLocationMethodDescriptor)
347             .setParamsExtractor(
348                 request -> {
349                   ImmutableMap.Builder<String, String> params = ImmutableMap.builder();
350                   params.put("name", String.valueOf(request.getName()));
351                   return params.build();
352                 })
353             .build();
354 
355     this.createFlowCallable =
356         callableFactory.createUnaryCallable(
357             createFlowTransportSettings, settings.createFlowSettings(), clientContext);
358     this.deleteFlowCallable =
359         callableFactory.createUnaryCallable(
360             deleteFlowTransportSettings, settings.deleteFlowSettings(), clientContext);
361     this.listFlowsCallable =
362         callableFactory.createUnaryCallable(
363             listFlowsTransportSettings, settings.listFlowsSettings(), clientContext);
364     this.listFlowsPagedCallable =
365         callableFactory.createPagedCallable(
366             listFlowsTransportSettings, settings.listFlowsSettings(), clientContext);
367     this.getFlowCallable =
368         callableFactory.createUnaryCallable(
369             getFlowTransportSettings, settings.getFlowSettings(), clientContext);
370     this.updateFlowCallable =
371         callableFactory.createUnaryCallable(
372             updateFlowTransportSettings, settings.updateFlowSettings(), clientContext);
373     this.trainFlowCallable =
374         callableFactory.createUnaryCallable(
375             trainFlowTransportSettings, settings.trainFlowSettings(), clientContext);
376     this.trainFlowOperationCallable =
377         callableFactory.createOperationCallable(
378             trainFlowTransportSettings,
379             settings.trainFlowOperationSettings(),
380             clientContext,
381             operationsStub);
382     this.validateFlowCallable =
383         callableFactory.createUnaryCallable(
384             validateFlowTransportSettings, settings.validateFlowSettings(), clientContext);
385     this.getFlowValidationResultCallable =
386         callableFactory.createUnaryCallable(
387             getFlowValidationResultTransportSettings,
388             settings.getFlowValidationResultSettings(),
389             clientContext);
390     this.importFlowCallable =
391         callableFactory.createUnaryCallable(
392             importFlowTransportSettings, settings.importFlowSettings(), clientContext);
393     this.importFlowOperationCallable =
394         callableFactory.createOperationCallable(
395             importFlowTransportSettings,
396             settings.importFlowOperationSettings(),
397             clientContext,
398             operationsStub);
399     this.exportFlowCallable =
400         callableFactory.createUnaryCallable(
401             exportFlowTransportSettings, settings.exportFlowSettings(), clientContext);
402     this.exportFlowOperationCallable =
403         callableFactory.createOperationCallable(
404             exportFlowTransportSettings,
405             settings.exportFlowOperationSettings(),
406             clientContext,
407             operationsStub);
408     this.listLocationsCallable =
409         callableFactory.createUnaryCallable(
410             listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
411     this.listLocationsPagedCallable =
412         callableFactory.createPagedCallable(
413             listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
414     this.getLocationCallable =
415         callableFactory.createUnaryCallable(
416             getLocationTransportSettings, settings.getLocationSettings(), clientContext);
417 
418     this.backgroundResources =
419         new BackgroundResourceAggregation(clientContext.getBackgroundResources());
420   }
421 
getOperationsStub()422   public GrpcOperationsStub getOperationsStub() {
423     return operationsStub;
424   }
425 
426   @Override
createFlowCallable()427   public UnaryCallable<CreateFlowRequest, Flow> createFlowCallable() {
428     return createFlowCallable;
429   }
430 
431   @Override
deleteFlowCallable()432   public UnaryCallable<DeleteFlowRequest, Empty> deleteFlowCallable() {
433     return deleteFlowCallable;
434   }
435 
436   @Override
listFlowsCallable()437   public UnaryCallable<ListFlowsRequest, ListFlowsResponse> listFlowsCallable() {
438     return listFlowsCallable;
439   }
440 
441   @Override
listFlowsPagedCallable()442   public UnaryCallable<ListFlowsRequest, ListFlowsPagedResponse> listFlowsPagedCallable() {
443     return listFlowsPagedCallable;
444   }
445 
446   @Override
getFlowCallable()447   public UnaryCallable<GetFlowRequest, Flow> getFlowCallable() {
448     return getFlowCallable;
449   }
450 
451   @Override
updateFlowCallable()452   public UnaryCallable<UpdateFlowRequest, Flow> updateFlowCallable() {
453     return updateFlowCallable;
454   }
455 
456   @Override
trainFlowCallable()457   public UnaryCallable<TrainFlowRequest, Operation> trainFlowCallable() {
458     return trainFlowCallable;
459   }
460 
461   @Override
trainFlowOperationCallable()462   public OperationCallable<TrainFlowRequest, Empty, Struct> trainFlowOperationCallable() {
463     return trainFlowOperationCallable;
464   }
465 
466   @Override
validateFlowCallable()467   public UnaryCallable<ValidateFlowRequest, FlowValidationResult> validateFlowCallable() {
468     return validateFlowCallable;
469   }
470 
471   @Override
472   public UnaryCallable<GetFlowValidationResultRequest, FlowValidationResult>
getFlowValidationResultCallable()473       getFlowValidationResultCallable() {
474     return getFlowValidationResultCallable;
475   }
476 
477   @Override
importFlowCallable()478   public UnaryCallable<ImportFlowRequest, Operation> importFlowCallable() {
479     return importFlowCallable;
480   }
481 
482   @Override
483   public OperationCallable<ImportFlowRequest, ImportFlowResponse, Struct>
importFlowOperationCallable()484       importFlowOperationCallable() {
485     return importFlowOperationCallable;
486   }
487 
488   @Override
exportFlowCallable()489   public UnaryCallable<ExportFlowRequest, Operation> exportFlowCallable() {
490     return exportFlowCallable;
491   }
492 
493   @Override
494   public OperationCallable<ExportFlowRequest, ExportFlowResponse, Struct>
exportFlowOperationCallable()495       exportFlowOperationCallable() {
496     return exportFlowOperationCallable;
497   }
498 
499   @Override
listLocationsCallable()500   public UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
501     return listLocationsCallable;
502   }
503 
504   @Override
505   public UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable()506       listLocationsPagedCallable() {
507     return listLocationsPagedCallable;
508   }
509 
510   @Override
getLocationCallable()511   public UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
512     return getLocationCallable;
513   }
514 
515   @Override
close()516   public final void close() {
517     try {
518       backgroundResources.close();
519     } catch (RuntimeException e) {
520       throw e;
521     } catch (Exception e) {
522       throw new IllegalStateException("Failed to close resource", e);
523     }
524   }
525 
526   @Override
shutdown()527   public void shutdown() {
528     backgroundResources.shutdown();
529   }
530 
531   @Override
isShutdown()532   public boolean isShutdown() {
533     return backgroundResources.isShutdown();
534   }
535 
536   @Override
isTerminated()537   public boolean isTerminated() {
538     return backgroundResources.isTerminated();
539   }
540 
541   @Override
shutdownNow()542   public void shutdownNow() {
543     backgroundResources.shutdownNow();
544   }
545 
546   @Override
awaitTermination(long duration, TimeUnit unit)547   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
548     return backgroundResources.awaitTermination(duration, unit);
549   }
550 }
551