• 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.aiplatform.v1;
18 
19 import com.google.api.core.ApiFuture;
20 import com.google.api.core.ApiFutures;
21 import com.google.api.gax.core.BackgroundResource;
22 import com.google.api.gax.longrunning.OperationFuture;
23 import com.google.api.gax.paging.AbstractFixedSizeCollection;
24 import com.google.api.gax.paging.AbstractPage;
25 import com.google.api.gax.paging.AbstractPagedListResponse;
26 import com.google.api.gax.rpc.OperationCallable;
27 import com.google.api.gax.rpc.PageContext;
28 import com.google.api.gax.rpc.UnaryCallable;
29 import com.google.cloud.aiplatform.v1.stub.PipelineServiceStub;
30 import com.google.cloud.aiplatform.v1.stub.PipelineServiceStubSettings;
31 import com.google.cloud.location.GetLocationRequest;
32 import com.google.cloud.location.ListLocationsRequest;
33 import com.google.cloud.location.ListLocationsResponse;
34 import com.google.cloud.location.Location;
35 import com.google.common.util.concurrent.MoreExecutors;
36 import com.google.iam.v1.GetIamPolicyRequest;
37 import com.google.iam.v1.Policy;
38 import com.google.iam.v1.SetIamPolicyRequest;
39 import com.google.iam.v1.TestIamPermissionsRequest;
40 import com.google.iam.v1.TestIamPermissionsResponse;
41 import com.google.longrunning.Operation;
42 import com.google.longrunning.OperationsClient;
43 import com.google.protobuf.Empty;
44 import java.io.IOException;
45 import java.util.List;
46 import java.util.concurrent.TimeUnit;
47 import javax.annotation.Generated;
48 
49 // AUTO-GENERATED DOCUMENTATION AND CLASS.
50 /**
51  * Service Description: A service for creating and managing Vertex AI's pipelines. This includes
52  * both `TrainingPipeline` resources (used for AutoML and custom training) and `PipelineJob`
53  * resources (used for Vertex AI Pipelines).
54  *
55  * <p>This class provides the ability to make remote calls to the backing service through method
56  * calls that map to API methods. Sample code to get started:
57  *
58  * <pre>{@code
59  * // This snippet has been automatically generated and should be regarded as a code template only.
60  * // It will require modifications to work:
61  * // - It may require correct/in-range values for request initialization.
62  * // - It may require specifying regional endpoints when creating the service client as shown in
63  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
64  * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
65  *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
66  *   TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
67  *   TrainingPipeline response =
68  *       pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
69  * }
70  * }</pre>
71  *
72  * <p>Note: close() needs to be called on the PipelineServiceClient object to clean up resources
73  * such as threads. In the example above, try-with-resources is used, which automatically calls
74  * close().
75  *
76  * <p>The surface of this class includes several types of Java methods for each of the API's
77  * methods:
78  *
79  * <ol>
80  *   <li>A "flattened" method. With this type of method, the fields of the request type have been
81  *       converted into function parameters. It may be the case that not all fields are available as
82  *       parameters, and not every API method will have a flattened method entry point.
83  *   <li>A "request object" method. This type of method only takes one parameter, a request object,
84  *       which must be constructed before the call. Not every API method will have a request object
85  *       method.
86  *   <li>A "callable" method. This type of method takes no parameters and returns an immutable API
87  *       callable object, which can be used to initiate calls to the service.
88  * </ol>
89  *
90  * <p>See the individual methods for example code.
91  *
92  * <p>Many parameters require resource names to be formatted in a particular way. To assist with
93  * these names, this class includes a format method for each type of name, and additionally a parse
94  * method to extract the individual identifiers contained within names that are returned.
95  *
96  * <p>This class can be customized by passing in a custom instance of PipelineServiceSettings to
97  * create(). For example:
98  *
99  * <p>To customize credentials:
100  *
101  * <pre>{@code
102  * // This snippet has been automatically generated and should be regarded as a code template only.
103  * // It will require modifications to work:
104  * // - It may require correct/in-range values for request initialization.
105  * // - It may require specifying regional endpoints when creating the service client as shown in
106  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
107  * PipelineServiceSettings pipelineServiceSettings =
108  *     PipelineServiceSettings.newBuilder()
109  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
110  *         .build();
111  * PipelineServiceClient pipelineServiceClient =
112  *     PipelineServiceClient.create(pipelineServiceSettings);
113  * }</pre>
114  *
115  * <p>To customize the endpoint:
116  *
117  * <pre>{@code
118  * // This snippet has been automatically generated and should be regarded as a code template only.
119  * // It will require modifications to work:
120  * // - It may require correct/in-range values for request initialization.
121  * // - It may require specifying regional endpoints when creating the service client as shown in
122  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
123  * PipelineServiceSettings pipelineServiceSettings =
124  *     PipelineServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
125  * PipelineServiceClient pipelineServiceClient =
126  *     PipelineServiceClient.create(pipelineServiceSettings);
127  * }</pre>
128  *
129  * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
130  */
131 @Generated("by gapic-generator-java")
132 public class PipelineServiceClient implements BackgroundResource {
133   private final PipelineServiceSettings settings;
134   private final PipelineServiceStub stub;
135   private final OperationsClient operationsClient;
136 
137   /** Constructs an instance of PipelineServiceClient with default settings. */
create()138   public static final PipelineServiceClient create() throws IOException {
139     return create(PipelineServiceSettings.newBuilder().build());
140   }
141 
142   /**
143    * Constructs an instance of PipelineServiceClient, using the given settings. The channels are
144    * created based on the settings passed in, or defaults for any settings that are not set.
145    */
create(PipelineServiceSettings settings)146   public static final PipelineServiceClient create(PipelineServiceSettings settings)
147       throws IOException {
148     return new PipelineServiceClient(settings);
149   }
150 
151   /**
152    * Constructs an instance of PipelineServiceClient, using the given stub for making calls. This is
153    * for advanced usage - prefer using create(PipelineServiceSettings).
154    */
create(PipelineServiceStub stub)155   public static final PipelineServiceClient create(PipelineServiceStub stub) {
156     return new PipelineServiceClient(stub);
157   }
158 
159   /**
160    * Constructs an instance of PipelineServiceClient, using the given settings. This is protected so
161    * that it is easy to make a subclass, but otherwise, the static factory methods should be
162    * preferred.
163    */
PipelineServiceClient(PipelineServiceSettings settings)164   protected PipelineServiceClient(PipelineServiceSettings settings) throws IOException {
165     this.settings = settings;
166     this.stub = ((PipelineServiceStubSettings) settings.getStubSettings()).createStub();
167     this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
168   }
169 
PipelineServiceClient(PipelineServiceStub stub)170   protected PipelineServiceClient(PipelineServiceStub stub) {
171     this.settings = null;
172     this.stub = stub;
173     this.operationsClient = OperationsClient.create(this.stub.getOperationsStub());
174   }
175 
getSettings()176   public final PipelineServiceSettings getSettings() {
177     return settings;
178   }
179 
getStub()180   public PipelineServiceStub getStub() {
181     return stub;
182   }
183 
184   /**
185    * Returns the OperationsClient that can be used to query the status of a long-running operation
186    * returned by another API method call.
187    */
getOperationsClient()188   public final OperationsClient getOperationsClient() {
189     return operationsClient;
190   }
191 
192   // AUTO-GENERATED DOCUMENTATION AND METHOD.
193   /**
194    * Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
195    *
196    * <p>Sample code:
197    *
198    * <pre>{@code
199    * // This snippet has been automatically generated and should be regarded as a code template only.
200    * // It will require modifications to work:
201    * // - It may require correct/in-range values for request initialization.
202    * // - It may require specifying regional endpoints when creating the service client as shown in
203    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
204    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
205    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
206    *   TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
207    *   TrainingPipeline response =
208    *       pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
209    * }
210    * }</pre>
211    *
212    * @param parent Required. The resource name of the Location to create the TrainingPipeline in.
213    *     Format: `projects/{project}/locations/{location}`
214    * @param trainingPipeline Required. The TrainingPipeline to create.
215    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
216    */
createTrainingPipeline( LocationName parent, TrainingPipeline trainingPipeline)217   public final TrainingPipeline createTrainingPipeline(
218       LocationName parent, TrainingPipeline trainingPipeline) {
219     CreateTrainingPipelineRequest request =
220         CreateTrainingPipelineRequest.newBuilder()
221             .setParent(parent == null ? null : parent.toString())
222             .setTrainingPipeline(trainingPipeline)
223             .build();
224     return createTrainingPipeline(request);
225   }
226 
227   // AUTO-GENERATED DOCUMENTATION AND METHOD.
228   /**
229    * Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
230    *
231    * <p>Sample code:
232    *
233    * <pre>{@code
234    * // This snippet has been automatically generated and should be regarded as a code template only.
235    * // It will require modifications to work:
236    * // - It may require correct/in-range values for request initialization.
237    * // - It may require specifying regional endpoints when creating the service client as shown in
238    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
239    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
240    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
241    *   TrainingPipeline trainingPipeline = TrainingPipeline.newBuilder().build();
242    *   TrainingPipeline response =
243    *       pipelineServiceClient.createTrainingPipeline(parent, trainingPipeline);
244    * }
245    * }</pre>
246    *
247    * @param parent Required. The resource name of the Location to create the TrainingPipeline in.
248    *     Format: `projects/{project}/locations/{location}`
249    * @param trainingPipeline Required. The TrainingPipeline to create.
250    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
251    */
createTrainingPipeline( String parent, TrainingPipeline trainingPipeline)252   public final TrainingPipeline createTrainingPipeline(
253       String parent, TrainingPipeline trainingPipeline) {
254     CreateTrainingPipelineRequest request =
255         CreateTrainingPipelineRequest.newBuilder()
256             .setParent(parent)
257             .setTrainingPipeline(trainingPipeline)
258             .build();
259     return createTrainingPipeline(request);
260   }
261 
262   // AUTO-GENERATED DOCUMENTATION AND METHOD.
263   /**
264    * Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
265    *
266    * <p>Sample code:
267    *
268    * <pre>{@code
269    * // This snippet has been automatically generated and should be regarded as a code template only.
270    * // It will require modifications to work:
271    * // - It may require correct/in-range values for request initialization.
272    * // - It may require specifying regional endpoints when creating the service client as shown in
273    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
274    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
275    *   CreateTrainingPipelineRequest request =
276    *       CreateTrainingPipelineRequest.newBuilder()
277    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
278    *           .setTrainingPipeline(TrainingPipeline.newBuilder().build())
279    *           .build();
280    *   TrainingPipeline response = pipelineServiceClient.createTrainingPipeline(request);
281    * }
282    * }</pre>
283    *
284    * @param request The request object containing all of the parameters for the API call.
285    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
286    */
createTrainingPipeline(CreateTrainingPipelineRequest request)287   public final TrainingPipeline createTrainingPipeline(CreateTrainingPipelineRequest request) {
288     return createTrainingPipelineCallable().call(request);
289   }
290 
291   // AUTO-GENERATED DOCUMENTATION AND METHOD.
292   /**
293    * Creates a TrainingPipeline. A created TrainingPipeline right away will be attempted to be run.
294    *
295    * <p>Sample code:
296    *
297    * <pre>{@code
298    * // This snippet has been automatically generated and should be regarded as a code template only.
299    * // It will require modifications to work:
300    * // - It may require correct/in-range values for request initialization.
301    * // - It may require specifying regional endpoints when creating the service client as shown in
302    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
303    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
304    *   CreateTrainingPipelineRequest request =
305    *       CreateTrainingPipelineRequest.newBuilder()
306    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
307    *           .setTrainingPipeline(TrainingPipeline.newBuilder().build())
308    *           .build();
309    *   ApiFuture<TrainingPipeline> future =
310    *       pipelineServiceClient.createTrainingPipelineCallable().futureCall(request);
311    *   // Do something.
312    *   TrainingPipeline response = future.get();
313    * }
314    * }</pre>
315    */
316   public final UnaryCallable<CreateTrainingPipelineRequest, TrainingPipeline>
createTrainingPipelineCallable()317       createTrainingPipelineCallable() {
318     return stub.createTrainingPipelineCallable();
319   }
320 
321   // AUTO-GENERATED DOCUMENTATION AND METHOD.
322   /**
323    * Gets a TrainingPipeline.
324    *
325    * <p>Sample code:
326    *
327    * <pre>{@code
328    * // This snippet has been automatically generated and should be regarded as a code template only.
329    * // It will require modifications to work:
330    * // - It may require correct/in-range values for request initialization.
331    * // - It may require specifying regional endpoints when creating the service client as shown in
332    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
333    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
334    *   TrainingPipelineName name =
335    *       TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
336    *   TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
337    * }
338    * }</pre>
339    *
340    * @param name Required. The name of the TrainingPipeline resource. Format:
341    *     `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
342    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
343    */
getTrainingPipeline(TrainingPipelineName name)344   public final TrainingPipeline getTrainingPipeline(TrainingPipelineName name) {
345     GetTrainingPipelineRequest request =
346         GetTrainingPipelineRequest.newBuilder()
347             .setName(name == null ? null : name.toString())
348             .build();
349     return getTrainingPipeline(request);
350   }
351 
352   // AUTO-GENERATED DOCUMENTATION AND METHOD.
353   /**
354    * Gets a TrainingPipeline.
355    *
356    * <p>Sample code:
357    *
358    * <pre>{@code
359    * // This snippet has been automatically generated and should be regarded as a code template only.
360    * // It will require modifications to work:
361    * // - It may require correct/in-range values for request initialization.
362    * // - It may require specifying regional endpoints when creating the service client as shown in
363    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
364    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
365    *   String name =
366    *       TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
367    *   TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(name);
368    * }
369    * }</pre>
370    *
371    * @param name Required. The name of the TrainingPipeline resource. Format:
372    *     `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
373    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
374    */
getTrainingPipeline(String name)375   public final TrainingPipeline getTrainingPipeline(String name) {
376     GetTrainingPipelineRequest request =
377         GetTrainingPipelineRequest.newBuilder().setName(name).build();
378     return getTrainingPipeline(request);
379   }
380 
381   // AUTO-GENERATED DOCUMENTATION AND METHOD.
382   /**
383    * Gets a TrainingPipeline.
384    *
385    * <p>Sample code:
386    *
387    * <pre>{@code
388    * // This snippet has been automatically generated and should be regarded as a code template only.
389    * // It will require modifications to work:
390    * // - It may require correct/in-range values for request initialization.
391    * // - It may require specifying regional endpoints when creating the service client as shown in
392    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
393    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
394    *   GetTrainingPipelineRequest request =
395    *       GetTrainingPipelineRequest.newBuilder()
396    *           .setName(
397    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
398    *                   .toString())
399    *           .build();
400    *   TrainingPipeline response = pipelineServiceClient.getTrainingPipeline(request);
401    * }
402    * }</pre>
403    *
404    * @param request The request object containing all of the parameters for the API call.
405    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
406    */
getTrainingPipeline(GetTrainingPipelineRequest request)407   public final TrainingPipeline getTrainingPipeline(GetTrainingPipelineRequest request) {
408     return getTrainingPipelineCallable().call(request);
409   }
410 
411   // AUTO-GENERATED DOCUMENTATION AND METHOD.
412   /**
413    * Gets a TrainingPipeline.
414    *
415    * <p>Sample code:
416    *
417    * <pre>{@code
418    * // This snippet has been automatically generated and should be regarded as a code template only.
419    * // It will require modifications to work:
420    * // - It may require correct/in-range values for request initialization.
421    * // - It may require specifying regional endpoints when creating the service client as shown in
422    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
423    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
424    *   GetTrainingPipelineRequest request =
425    *       GetTrainingPipelineRequest.newBuilder()
426    *           .setName(
427    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
428    *                   .toString())
429    *           .build();
430    *   ApiFuture<TrainingPipeline> future =
431    *       pipelineServiceClient.getTrainingPipelineCallable().futureCall(request);
432    *   // Do something.
433    *   TrainingPipeline response = future.get();
434    * }
435    * }</pre>
436    */
437   public final UnaryCallable<GetTrainingPipelineRequest, TrainingPipeline>
getTrainingPipelineCallable()438       getTrainingPipelineCallable() {
439     return stub.getTrainingPipelineCallable();
440   }
441 
442   // AUTO-GENERATED DOCUMENTATION AND METHOD.
443   /**
444    * Lists TrainingPipelines in a Location.
445    *
446    * <p>Sample code:
447    *
448    * <pre>{@code
449    * // This snippet has been automatically generated and should be regarded as a code template only.
450    * // It will require modifications to work:
451    * // - It may require correct/in-range values for request initialization.
452    * // - It may require specifying regional endpoints when creating the service client as shown in
453    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
454    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
455    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
456    *   for (TrainingPipeline element :
457    *       pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
458    *     // doThingsWith(element);
459    *   }
460    * }
461    * }</pre>
462    *
463    * @param parent Required. The resource name of the Location to list the TrainingPipelines from.
464    *     Format: `projects/{project}/locations/{location}`
465    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
466    */
listTrainingPipelines(LocationName parent)467   public final ListTrainingPipelinesPagedResponse listTrainingPipelines(LocationName parent) {
468     ListTrainingPipelinesRequest request =
469         ListTrainingPipelinesRequest.newBuilder()
470             .setParent(parent == null ? null : parent.toString())
471             .build();
472     return listTrainingPipelines(request);
473   }
474 
475   // AUTO-GENERATED DOCUMENTATION AND METHOD.
476   /**
477    * Lists TrainingPipelines in a Location.
478    *
479    * <p>Sample code:
480    *
481    * <pre>{@code
482    * // This snippet has been automatically generated and should be regarded as a code template only.
483    * // It will require modifications to work:
484    * // - It may require correct/in-range values for request initialization.
485    * // - It may require specifying regional endpoints when creating the service client as shown in
486    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
487    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
488    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
489    *   for (TrainingPipeline element :
490    *       pipelineServiceClient.listTrainingPipelines(parent).iterateAll()) {
491    *     // doThingsWith(element);
492    *   }
493    * }
494    * }</pre>
495    *
496    * @param parent Required. The resource name of the Location to list the TrainingPipelines from.
497    *     Format: `projects/{project}/locations/{location}`
498    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
499    */
listTrainingPipelines(String parent)500   public final ListTrainingPipelinesPagedResponse listTrainingPipelines(String parent) {
501     ListTrainingPipelinesRequest request =
502         ListTrainingPipelinesRequest.newBuilder().setParent(parent).build();
503     return listTrainingPipelines(request);
504   }
505 
506   // AUTO-GENERATED DOCUMENTATION AND METHOD.
507   /**
508    * Lists TrainingPipelines in a Location.
509    *
510    * <p>Sample code:
511    *
512    * <pre>{@code
513    * // This snippet has been automatically generated and should be regarded as a code template only.
514    * // It will require modifications to work:
515    * // - It may require correct/in-range values for request initialization.
516    * // - It may require specifying regional endpoints when creating the service client as shown in
517    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
518    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
519    *   ListTrainingPipelinesRequest request =
520    *       ListTrainingPipelinesRequest.newBuilder()
521    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
522    *           .setFilter("filter-1274492040")
523    *           .setPageSize(883849137)
524    *           .setPageToken("pageToken873572522")
525    *           .setReadMask(FieldMask.newBuilder().build())
526    *           .build();
527    *   for (TrainingPipeline element :
528    *       pipelineServiceClient.listTrainingPipelines(request).iterateAll()) {
529    *     // doThingsWith(element);
530    *   }
531    * }
532    * }</pre>
533    *
534    * @param request The request object containing all of the parameters for the API call.
535    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
536    */
listTrainingPipelines( ListTrainingPipelinesRequest request)537   public final ListTrainingPipelinesPagedResponse listTrainingPipelines(
538       ListTrainingPipelinesRequest request) {
539     return listTrainingPipelinesPagedCallable().call(request);
540   }
541 
542   // AUTO-GENERATED DOCUMENTATION AND METHOD.
543   /**
544    * Lists TrainingPipelines in a Location.
545    *
546    * <p>Sample code:
547    *
548    * <pre>{@code
549    * // This snippet has been automatically generated and should be regarded as a code template only.
550    * // It will require modifications to work:
551    * // - It may require correct/in-range values for request initialization.
552    * // - It may require specifying regional endpoints when creating the service client as shown in
553    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
554    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
555    *   ListTrainingPipelinesRequest request =
556    *       ListTrainingPipelinesRequest.newBuilder()
557    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
558    *           .setFilter("filter-1274492040")
559    *           .setPageSize(883849137)
560    *           .setPageToken("pageToken873572522")
561    *           .setReadMask(FieldMask.newBuilder().build())
562    *           .build();
563    *   ApiFuture<TrainingPipeline> future =
564    *       pipelineServiceClient.listTrainingPipelinesPagedCallable().futureCall(request);
565    *   // Do something.
566    *   for (TrainingPipeline element : future.get().iterateAll()) {
567    *     // doThingsWith(element);
568    *   }
569    * }
570    * }</pre>
571    */
572   public final UnaryCallable<ListTrainingPipelinesRequest, ListTrainingPipelinesPagedResponse>
listTrainingPipelinesPagedCallable()573       listTrainingPipelinesPagedCallable() {
574     return stub.listTrainingPipelinesPagedCallable();
575   }
576 
577   // AUTO-GENERATED DOCUMENTATION AND METHOD.
578   /**
579    * Lists TrainingPipelines in a Location.
580    *
581    * <p>Sample code:
582    *
583    * <pre>{@code
584    * // This snippet has been automatically generated and should be regarded as a code template only.
585    * // It will require modifications to work:
586    * // - It may require correct/in-range values for request initialization.
587    * // - It may require specifying regional endpoints when creating the service client as shown in
588    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
589    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
590    *   ListTrainingPipelinesRequest request =
591    *       ListTrainingPipelinesRequest.newBuilder()
592    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
593    *           .setFilter("filter-1274492040")
594    *           .setPageSize(883849137)
595    *           .setPageToken("pageToken873572522")
596    *           .setReadMask(FieldMask.newBuilder().build())
597    *           .build();
598    *   while (true) {
599    *     ListTrainingPipelinesResponse response =
600    *         pipelineServiceClient.listTrainingPipelinesCallable().call(request);
601    *     for (TrainingPipeline element : response.getTrainingPipelinesList()) {
602    *       // doThingsWith(element);
603    *     }
604    *     String nextPageToken = response.getNextPageToken();
605    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
606    *       request = request.toBuilder().setPageToken(nextPageToken).build();
607    *     } else {
608    *       break;
609    *     }
610    *   }
611    * }
612    * }</pre>
613    */
614   public final UnaryCallable<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse>
listTrainingPipelinesCallable()615       listTrainingPipelinesCallable() {
616     return stub.listTrainingPipelinesCallable();
617   }
618 
619   // AUTO-GENERATED DOCUMENTATION AND METHOD.
620   /**
621    * Deletes a TrainingPipeline.
622    *
623    * <p>Sample code:
624    *
625    * <pre>{@code
626    * // This snippet has been automatically generated and should be regarded as a code template only.
627    * // It will require modifications to work:
628    * // - It may require correct/in-range values for request initialization.
629    * // - It may require specifying regional endpoints when creating the service client as shown in
630    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
631    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
632    *   TrainingPipelineName name =
633    *       TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
634    *   pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
635    * }
636    * }</pre>
637    *
638    * @param name Required. The name of the TrainingPipeline resource to be deleted. Format:
639    *     `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
640    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
641    */
deleteTrainingPipelineAsync( TrainingPipelineName name)642   public final OperationFuture<Empty, DeleteOperationMetadata> deleteTrainingPipelineAsync(
643       TrainingPipelineName name) {
644     DeleteTrainingPipelineRequest request =
645         DeleteTrainingPipelineRequest.newBuilder()
646             .setName(name == null ? null : name.toString())
647             .build();
648     return deleteTrainingPipelineAsync(request);
649   }
650 
651   // AUTO-GENERATED DOCUMENTATION AND METHOD.
652   /**
653    * Deletes a TrainingPipeline.
654    *
655    * <p>Sample code:
656    *
657    * <pre>{@code
658    * // This snippet has been automatically generated and should be regarded as a code template only.
659    * // It will require modifications to work:
660    * // - It may require correct/in-range values for request initialization.
661    * // - It may require specifying regional endpoints when creating the service client as shown in
662    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
663    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
664    *   String name =
665    *       TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
666    *   pipelineServiceClient.deleteTrainingPipelineAsync(name).get();
667    * }
668    * }</pre>
669    *
670    * @param name Required. The name of the TrainingPipeline resource to be deleted. Format:
671    *     `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
672    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
673    */
deleteTrainingPipelineAsync( String name)674   public final OperationFuture<Empty, DeleteOperationMetadata> deleteTrainingPipelineAsync(
675       String name) {
676     DeleteTrainingPipelineRequest request =
677         DeleteTrainingPipelineRequest.newBuilder().setName(name).build();
678     return deleteTrainingPipelineAsync(request);
679   }
680 
681   // AUTO-GENERATED DOCUMENTATION AND METHOD.
682   /**
683    * Deletes a TrainingPipeline.
684    *
685    * <p>Sample code:
686    *
687    * <pre>{@code
688    * // This snippet has been automatically generated and should be regarded as a code template only.
689    * // It will require modifications to work:
690    * // - It may require correct/in-range values for request initialization.
691    * // - It may require specifying regional endpoints when creating the service client as shown in
692    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
693    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
694    *   DeleteTrainingPipelineRequest request =
695    *       DeleteTrainingPipelineRequest.newBuilder()
696    *           .setName(
697    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
698    *                   .toString())
699    *           .build();
700    *   pipelineServiceClient.deleteTrainingPipelineAsync(request).get();
701    * }
702    * }</pre>
703    *
704    * @param request The request object containing all of the parameters for the API call.
705    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
706    */
deleteTrainingPipelineAsync( DeleteTrainingPipelineRequest request)707   public final OperationFuture<Empty, DeleteOperationMetadata> deleteTrainingPipelineAsync(
708       DeleteTrainingPipelineRequest request) {
709     return deleteTrainingPipelineOperationCallable().futureCall(request);
710   }
711 
712   // AUTO-GENERATED DOCUMENTATION AND METHOD.
713   /**
714    * Deletes a TrainingPipeline.
715    *
716    * <p>Sample code:
717    *
718    * <pre>{@code
719    * // This snippet has been automatically generated and should be regarded as a code template only.
720    * // It will require modifications to work:
721    * // - It may require correct/in-range values for request initialization.
722    * // - It may require specifying regional endpoints when creating the service client as shown in
723    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
724    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
725    *   DeleteTrainingPipelineRequest request =
726    *       DeleteTrainingPipelineRequest.newBuilder()
727    *           .setName(
728    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
729    *                   .toString())
730    *           .build();
731    *   OperationFuture<Empty, DeleteOperationMetadata> future =
732    *       pipelineServiceClient.deleteTrainingPipelineOperationCallable().futureCall(request);
733    *   // Do something.
734    *   future.get();
735    * }
736    * }</pre>
737    */
738   public final OperationCallable<DeleteTrainingPipelineRequest, Empty, DeleteOperationMetadata>
deleteTrainingPipelineOperationCallable()739       deleteTrainingPipelineOperationCallable() {
740     return stub.deleteTrainingPipelineOperationCallable();
741   }
742 
743   // AUTO-GENERATED DOCUMENTATION AND METHOD.
744   /**
745    * Deletes a TrainingPipeline.
746    *
747    * <p>Sample code:
748    *
749    * <pre>{@code
750    * // This snippet has been automatically generated and should be regarded as a code template only.
751    * // It will require modifications to work:
752    * // - It may require correct/in-range values for request initialization.
753    * // - It may require specifying regional endpoints when creating the service client as shown in
754    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
755    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
756    *   DeleteTrainingPipelineRequest request =
757    *       DeleteTrainingPipelineRequest.newBuilder()
758    *           .setName(
759    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
760    *                   .toString())
761    *           .build();
762    *   ApiFuture<Operation> future =
763    *       pipelineServiceClient.deleteTrainingPipelineCallable().futureCall(request);
764    *   // Do something.
765    *   future.get();
766    * }
767    * }</pre>
768    */
769   public final UnaryCallable<DeleteTrainingPipelineRequest, Operation>
deleteTrainingPipelineCallable()770       deleteTrainingPipelineCallable() {
771     return stub.deleteTrainingPipelineCallable();
772   }
773 
774   // AUTO-GENERATED DOCUMENTATION AND METHOD.
775   /**
776    * Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
777    * server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
778    * use
779    * [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
780    * or other methods to check whether the cancellation succeeded or whether the pipeline completed
781    * despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead
782    * it becomes a pipeline with a
783    * [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] value with a
784    * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
785    * [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to
786    * `CANCELLED`.
787    *
788    * <p>Sample code:
789    *
790    * <pre>{@code
791    * // This snippet has been automatically generated and should be regarded as a code template only.
792    * // It will require modifications to work:
793    * // - It may require correct/in-range values for request initialization.
794    * // - It may require specifying regional endpoints when creating the service client as shown in
795    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
796    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
797    *   TrainingPipelineName name =
798    *       TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]");
799    *   pipelineServiceClient.cancelTrainingPipeline(name);
800    * }
801    * }</pre>
802    *
803    * @param name Required. The name of the TrainingPipeline to cancel. Format:
804    *     `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
805    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
806    */
cancelTrainingPipeline(TrainingPipelineName name)807   public final void cancelTrainingPipeline(TrainingPipelineName name) {
808     CancelTrainingPipelineRequest request =
809         CancelTrainingPipelineRequest.newBuilder()
810             .setName(name == null ? null : name.toString())
811             .build();
812     cancelTrainingPipeline(request);
813   }
814 
815   // AUTO-GENERATED DOCUMENTATION AND METHOD.
816   /**
817    * Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
818    * server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
819    * use
820    * [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
821    * or other methods to check whether the cancellation succeeded or whether the pipeline completed
822    * despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead
823    * it becomes a pipeline with a
824    * [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] value with a
825    * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
826    * [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to
827    * `CANCELLED`.
828    *
829    * <p>Sample code:
830    *
831    * <pre>{@code
832    * // This snippet has been automatically generated and should be regarded as a code template only.
833    * // It will require modifications to work:
834    * // - It may require correct/in-range values for request initialization.
835    * // - It may require specifying regional endpoints when creating the service client as shown in
836    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
837    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
838    *   String name =
839    *       TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]").toString();
840    *   pipelineServiceClient.cancelTrainingPipeline(name);
841    * }
842    * }</pre>
843    *
844    * @param name Required. The name of the TrainingPipeline to cancel. Format:
845    *     `projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}`
846    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
847    */
cancelTrainingPipeline(String name)848   public final void cancelTrainingPipeline(String name) {
849     CancelTrainingPipelineRequest request =
850         CancelTrainingPipelineRequest.newBuilder().setName(name).build();
851     cancelTrainingPipeline(request);
852   }
853 
854   // AUTO-GENERATED DOCUMENTATION AND METHOD.
855   /**
856    * Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
857    * server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
858    * use
859    * [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
860    * or other methods to check whether the cancellation succeeded or whether the pipeline completed
861    * despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead
862    * it becomes a pipeline with a
863    * [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] value with a
864    * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
865    * [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to
866    * `CANCELLED`.
867    *
868    * <p>Sample code:
869    *
870    * <pre>{@code
871    * // This snippet has been automatically generated and should be regarded as a code template only.
872    * // It will require modifications to work:
873    * // - It may require correct/in-range values for request initialization.
874    * // - It may require specifying regional endpoints when creating the service client as shown in
875    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
876    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
877    *   CancelTrainingPipelineRequest request =
878    *       CancelTrainingPipelineRequest.newBuilder()
879    *           .setName(
880    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
881    *                   .toString())
882    *           .build();
883    *   pipelineServiceClient.cancelTrainingPipeline(request);
884    * }
885    * }</pre>
886    *
887    * @param request The request object containing all of the parameters for the API call.
888    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
889    */
cancelTrainingPipeline(CancelTrainingPipelineRequest request)890   public final void cancelTrainingPipeline(CancelTrainingPipelineRequest request) {
891     cancelTrainingPipelineCallable().call(request);
892   }
893 
894   // AUTO-GENERATED DOCUMENTATION AND METHOD.
895   /**
896    * Cancels a TrainingPipeline. Starts asynchronous cancellation on the TrainingPipeline. The
897    * server makes a best effort to cancel the pipeline, but success is not guaranteed. Clients can
898    * use
899    * [PipelineService.GetTrainingPipeline][google.cloud.aiplatform.v1.PipelineService.GetTrainingPipeline]
900    * or other methods to check whether the cancellation succeeded or whether the pipeline completed
901    * despite cancellation. On successful cancellation, the TrainingPipeline is not deleted; instead
902    * it becomes a pipeline with a
903    * [TrainingPipeline.error][google.cloud.aiplatform.v1.TrainingPipeline.error] value with a
904    * [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to `Code.CANCELLED`, and
905    * [TrainingPipeline.state][google.cloud.aiplatform.v1.TrainingPipeline.state] is set to
906    * `CANCELLED`.
907    *
908    * <p>Sample code:
909    *
910    * <pre>{@code
911    * // This snippet has been automatically generated and should be regarded as a code template only.
912    * // It will require modifications to work:
913    * // - It may require correct/in-range values for request initialization.
914    * // - It may require specifying regional endpoints when creating the service client as shown in
915    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
916    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
917    *   CancelTrainingPipelineRequest request =
918    *       CancelTrainingPipelineRequest.newBuilder()
919    *           .setName(
920    *               TrainingPipelineName.of("[PROJECT]", "[LOCATION]", "[TRAINING_PIPELINE]")
921    *                   .toString())
922    *           .build();
923    *   ApiFuture<Empty> future =
924    *       pipelineServiceClient.cancelTrainingPipelineCallable().futureCall(request);
925    *   // Do something.
926    *   future.get();
927    * }
928    * }</pre>
929    */
930   public final UnaryCallable<CancelTrainingPipelineRequest, Empty>
cancelTrainingPipelineCallable()931       cancelTrainingPipelineCallable() {
932     return stub.cancelTrainingPipelineCallable();
933   }
934 
935   // AUTO-GENERATED DOCUMENTATION AND METHOD.
936   /**
937    * Creates a PipelineJob. A PipelineJob will run immediately when created.
938    *
939    * <p>Sample code:
940    *
941    * <pre>{@code
942    * // This snippet has been automatically generated and should be regarded as a code template only.
943    * // It will require modifications to work:
944    * // - It may require correct/in-range values for request initialization.
945    * // - It may require specifying regional endpoints when creating the service client as shown in
946    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
947    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
948    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
949    *   PipelineJob pipelineJob = PipelineJob.newBuilder().build();
950    *   String pipelineJobId = "pipelineJobId-1711315914";
951    *   PipelineJob response =
952    *       pipelineServiceClient.createPipelineJob(parent, pipelineJob, pipelineJobId);
953    * }
954    * }</pre>
955    *
956    * @param parent Required. The resource name of the Location to create the PipelineJob in. Format:
957    *     `projects/{project}/locations/{location}`
958    * @param pipelineJob Required. The PipelineJob to create.
959    * @param pipelineJobId The ID to use for the PipelineJob, which will become the final component
960    *     of the PipelineJob name. If not provided, an ID will be automatically generated.
961    *     <p>This value should be less than 128 characters, and valid characters are /[a-z][0-9]-/.
962    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
963    */
createPipelineJob( LocationName parent, PipelineJob pipelineJob, String pipelineJobId)964   public final PipelineJob createPipelineJob(
965       LocationName parent, PipelineJob pipelineJob, String pipelineJobId) {
966     CreatePipelineJobRequest request =
967         CreatePipelineJobRequest.newBuilder()
968             .setParent(parent == null ? null : parent.toString())
969             .setPipelineJob(pipelineJob)
970             .setPipelineJobId(pipelineJobId)
971             .build();
972     return createPipelineJob(request);
973   }
974 
975   // AUTO-GENERATED DOCUMENTATION AND METHOD.
976   /**
977    * Creates a PipelineJob. A PipelineJob will run immediately when created.
978    *
979    * <p>Sample code:
980    *
981    * <pre>{@code
982    * // This snippet has been automatically generated and should be regarded as a code template only.
983    * // It will require modifications to work:
984    * // - It may require correct/in-range values for request initialization.
985    * // - It may require specifying regional endpoints when creating the service client as shown in
986    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
987    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
988    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
989    *   PipelineJob pipelineJob = PipelineJob.newBuilder().build();
990    *   String pipelineJobId = "pipelineJobId-1711315914";
991    *   PipelineJob response =
992    *       pipelineServiceClient.createPipelineJob(parent, pipelineJob, pipelineJobId);
993    * }
994    * }</pre>
995    *
996    * @param parent Required. The resource name of the Location to create the PipelineJob in. Format:
997    *     `projects/{project}/locations/{location}`
998    * @param pipelineJob Required. The PipelineJob to create.
999    * @param pipelineJobId The ID to use for the PipelineJob, which will become the final component
1000    *     of the PipelineJob name. If not provided, an ID will be automatically generated.
1001    *     <p>This value should be less than 128 characters, and valid characters are /[a-z][0-9]-/.
1002    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1003    */
createPipelineJob( String parent, PipelineJob pipelineJob, String pipelineJobId)1004   public final PipelineJob createPipelineJob(
1005       String parent, PipelineJob pipelineJob, String pipelineJobId) {
1006     CreatePipelineJobRequest request =
1007         CreatePipelineJobRequest.newBuilder()
1008             .setParent(parent)
1009             .setPipelineJob(pipelineJob)
1010             .setPipelineJobId(pipelineJobId)
1011             .build();
1012     return createPipelineJob(request);
1013   }
1014 
1015   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1016   /**
1017    * Creates a PipelineJob. A PipelineJob will run immediately when created.
1018    *
1019    * <p>Sample code:
1020    *
1021    * <pre>{@code
1022    * // This snippet has been automatically generated and should be regarded as a code template only.
1023    * // It will require modifications to work:
1024    * // - It may require correct/in-range values for request initialization.
1025    * // - It may require specifying regional endpoints when creating the service client as shown in
1026    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1027    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1028    *   CreatePipelineJobRequest request =
1029    *       CreatePipelineJobRequest.newBuilder()
1030    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1031    *           .setPipelineJob(PipelineJob.newBuilder().build())
1032    *           .setPipelineJobId("pipelineJobId-1711315914")
1033    *           .build();
1034    *   PipelineJob response = pipelineServiceClient.createPipelineJob(request);
1035    * }
1036    * }</pre>
1037    *
1038    * @param request The request object containing all of the parameters for the API call.
1039    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1040    */
createPipelineJob(CreatePipelineJobRequest request)1041   public final PipelineJob createPipelineJob(CreatePipelineJobRequest request) {
1042     return createPipelineJobCallable().call(request);
1043   }
1044 
1045   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1046   /**
1047    * Creates a PipelineJob. A PipelineJob will run immediately when created.
1048    *
1049    * <p>Sample code:
1050    *
1051    * <pre>{@code
1052    * // This snippet has been automatically generated and should be regarded as a code template only.
1053    * // It will require modifications to work:
1054    * // - It may require correct/in-range values for request initialization.
1055    * // - It may require specifying regional endpoints when creating the service client as shown in
1056    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1057    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1058    *   CreatePipelineJobRequest request =
1059    *       CreatePipelineJobRequest.newBuilder()
1060    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1061    *           .setPipelineJob(PipelineJob.newBuilder().build())
1062    *           .setPipelineJobId("pipelineJobId-1711315914")
1063    *           .build();
1064    *   ApiFuture<PipelineJob> future =
1065    *       pipelineServiceClient.createPipelineJobCallable().futureCall(request);
1066    *   // Do something.
1067    *   PipelineJob response = future.get();
1068    * }
1069    * }</pre>
1070    */
createPipelineJobCallable()1071   public final UnaryCallable<CreatePipelineJobRequest, PipelineJob> createPipelineJobCallable() {
1072     return stub.createPipelineJobCallable();
1073   }
1074 
1075   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1076   /**
1077    * Gets a PipelineJob.
1078    *
1079    * <p>Sample code:
1080    *
1081    * <pre>{@code
1082    * // This snippet has been automatically generated and should be regarded as a code template only.
1083    * // It will require modifications to work:
1084    * // - It may require correct/in-range values for request initialization.
1085    * // - It may require specifying regional endpoints when creating the service client as shown in
1086    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1087    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1088    *   PipelineJobName name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]");
1089    *   PipelineJob response = pipelineServiceClient.getPipelineJob(name);
1090    * }
1091    * }</pre>
1092    *
1093    * @param name Required. The name of the PipelineJob resource. Format:
1094    *     `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
1095    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1096    */
getPipelineJob(PipelineJobName name)1097   public final PipelineJob getPipelineJob(PipelineJobName name) {
1098     GetPipelineJobRequest request =
1099         GetPipelineJobRequest.newBuilder().setName(name == null ? null : name.toString()).build();
1100     return getPipelineJob(request);
1101   }
1102 
1103   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1104   /**
1105    * Gets a PipelineJob.
1106    *
1107    * <p>Sample code:
1108    *
1109    * <pre>{@code
1110    * // This snippet has been automatically generated and should be regarded as a code template only.
1111    * // It will require modifications to work:
1112    * // - It may require correct/in-range values for request initialization.
1113    * // - It may require specifying regional endpoints when creating the service client as shown in
1114    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1115    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1116    *   String name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString();
1117    *   PipelineJob response = pipelineServiceClient.getPipelineJob(name);
1118    * }
1119    * }</pre>
1120    *
1121    * @param name Required. The name of the PipelineJob resource. Format:
1122    *     `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
1123    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1124    */
getPipelineJob(String name)1125   public final PipelineJob getPipelineJob(String name) {
1126     GetPipelineJobRequest request = GetPipelineJobRequest.newBuilder().setName(name).build();
1127     return getPipelineJob(request);
1128   }
1129 
1130   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1131   /**
1132    * Gets a PipelineJob.
1133    *
1134    * <p>Sample code:
1135    *
1136    * <pre>{@code
1137    * // This snippet has been automatically generated and should be regarded as a code template only.
1138    * // It will require modifications to work:
1139    * // - It may require correct/in-range values for request initialization.
1140    * // - It may require specifying regional endpoints when creating the service client as shown in
1141    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1142    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1143    *   GetPipelineJobRequest request =
1144    *       GetPipelineJobRequest.newBuilder()
1145    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1146    *           .build();
1147    *   PipelineJob response = pipelineServiceClient.getPipelineJob(request);
1148    * }
1149    * }</pre>
1150    *
1151    * @param request The request object containing all of the parameters for the API call.
1152    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1153    */
getPipelineJob(GetPipelineJobRequest request)1154   public final PipelineJob getPipelineJob(GetPipelineJobRequest request) {
1155     return getPipelineJobCallable().call(request);
1156   }
1157 
1158   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1159   /**
1160    * Gets a PipelineJob.
1161    *
1162    * <p>Sample code:
1163    *
1164    * <pre>{@code
1165    * // This snippet has been automatically generated and should be regarded as a code template only.
1166    * // It will require modifications to work:
1167    * // - It may require correct/in-range values for request initialization.
1168    * // - It may require specifying regional endpoints when creating the service client as shown in
1169    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1170    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1171    *   GetPipelineJobRequest request =
1172    *       GetPipelineJobRequest.newBuilder()
1173    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1174    *           .build();
1175    *   ApiFuture<PipelineJob> future =
1176    *       pipelineServiceClient.getPipelineJobCallable().futureCall(request);
1177    *   // Do something.
1178    *   PipelineJob response = future.get();
1179    * }
1180    * }</pre>
1181    */
getPipelineJobCallable()1182   public final UnaryCallable<GetPipelineJobRequest, PipelineJob> getPipelineJobCallable() {
1183     return stub.getPipelineJobCallable();
1184   }
1185 
1186   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1187   /**
1188    * Lists PipelineJobs in a Location.
1189    *
1190    * <p>Sample code:
1191    *
1192    * <pre>{@code
1193    * // This snippet has been automatically generated and should be regarded as a code template only.
1194    * // It will require modifications to work:
1195    * // - It may require correct/in-range values for request initialization.
1196    * // - It may require specifying regional endpoints when creating the service client as shown in
1197    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1198    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1199    *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
1200    *   for (PipelineJob element : pipelineServiceClient.listPipelineJobs(parent).iterateAll()) {
1201    *     // doThingsWith(element);
1202    *   }
1203    * }
1204    * }</pre>
1205    *
1206    * @param parent Required. The resource name of the Location to list the PipelineJobs from.
1207    *     Format: `projects/{project}/locations/{location}`
1208    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1209    */
listPipelineJobs(LocationName parent)1210   public final ListPipelineJobsPagedResponse listPipelineJobs(LocationName parent) {
1211     ListPipelineJobsRequest request =
1212         ListPipelineJobsRequest.newBuilder()
1213             .setParent(parent == null ? null : parent.toString())
1214             .build();
1215     return listPipelineJobs(request);
1216   }
1217 
1218   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1219   /**
1220    * Lists PipelineJobs in a Location.
1221    *
1222    * <p>Sample code:
1223    *
1224    * <pre>{@code
1225    * // This snippet has been automatically generated and should be regarded as a code template only.
1226    * // It will require modifications to work:
1227    * // - It may require correct/in-range values for request initialization.
1228    * // - It may require specifying regional endpoints when creating the service client as shown in
1229    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1230    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1231    *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
1232    *   for (PipelineJob element : pipelineServiceClient.listPipelineJobs(parent).iterateAll()) {
1233    *     // doThingsWith(element);
1234    *   }
1235    * }
1236    * }</pre>
1237    *
1238    * @param parent Required. The resource name of the Location to list the PipelineJobs from.
1239    *     Format: `projects/{project}/locations/{location}`
1240    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1241    */
listPipelineJobs(String parent)1242   public final ListPipelineJobsPagedResponse listPipelineJobs(String parent) {
1243     ListPipelineJobsRequest request =
1244         ListPipelineJobsRequest.newBuilder().setParent(parent).build();
1245     return listPipelineJobs(request);
1246   }
1247 
1248   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1249   /**
1250    * Lists PipelineJobs in a Location.
1251    *
1252    * <p>Sample code:
1253    *
1254    * <pre>{@code
1255    * // This snippet has been automatically generated and should be regarded as a code template only.
1256    * // It will require modifications to work:
1257    * // - It may require correct/in-range values for request initialization.
1258    * // - It may require specifying regional endpoints when creating the service client as shown in
1259    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1260    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1261    *   ListPipelineJobsRequest request =
1262    *       ListPipelineJobsRequest.newBuilder()
1263    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1264    *           .setFilter("filter-1274492040")
1265    *           .setPageSize(883849137)
1266    *           .setPageToken("pageToken873572522")
1267    *           .setOrderBy("orderBy-1207110587")
1268    *           .setReadMask(FieldMask.newBuilder().build())
1269    *           .build();
1270    *   for (PipelineJob element : pipelineServiceClient.listPipelineJobs(request).iterateAll()) {
1271    *     // doThingsWith(element);
1272    *   }
1273    * }
1274    * }</pre>
1275    *
1276    * @param request The request object containing all of the parameters for the API call.
1277    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1278    */
listPipelineJobs(ListPipelineJobsRequest request)1279   public final ListPipelineJobsPagedResponse listPipelineJobs(ListPipelineJobsRequest request) {
1280     return listPipelineJobsPagedCallable().call(request);
1281   }
1282 
1283   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1284   /**
1285    * Lists PipelineJobs in a Location.
1286    *
1287    * <p>Sample code:
1288    *
1289    * <pre>{@code
1290    * // This snippet has been automatically generated and should be regarded as a code template only.
1291    * // It will require modifications to work:
1292    * // - It may require correct/in-range values for request initialization.
1293    * // - It may require specifying regional endpoints when creating the service client as shown in
1294    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1295    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1296    *   ListPipelineJobsRequest request =
1297    *       ListPipelineJobsRequest.newBuilder()
1298    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1299    *           .setFilter("filter-1274492040")
1300    *           .setPageSize(883849137)
1301    *           .setPageToken("pageToken873572522")
1302    *           .setOrderBy("orderBy-1207110587")
1303    *           .setReadMask(FieldMask.newBuilder().build())
1304    *           .build();
1305    *   ApiFuture<PipelineJob> future =
1306    *       pipelineServiceClient.listPipelineJobsPagedCallable().futureCall(request);
1307    *   // Do something.
1308    *   for (PipelineJob element : future.get().iterateAll()) {
1309    *     // doThingsWith(element);
1310    *   }
1311    * }
1312    * }</pre>
1313    */
1314   public final UnaryCallable<ListPipelineJobsRequest, ListPipelineJobsPagedResponse>
listPipelineJobsPagedCallable()1315       listPipelineJobsPagedCallable() {
1316     return stub.listPipelineJobsPagedCallable();
1317   }
1318 
1319   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1320   /**
1321    * Lists PipelineJobs in a Location.
1322    *
1323    * <p>Sample code:
1324    *
1325    * <pre>{@code
1326    * // This snippet has been automatically generated and should be regarded as a code template only.
1327    * // It will require modifications to work:
1328    * // - It may require correct/in-range values for request initialization.
1329    * // - It may require specifying regional endpoints when creating the service client as shown in
1330    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1331    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1332    *   ListPipelineJobsRequest request =
1333    *       ListPipelineJobsRequest.newBuilder()
1334    *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
1335    *           .setFilter("filter-1274492040")
1336    *           .setPageSize(883849137)
1337    *           .setPageToken("pageToken873572522")
1338    *           .setOrderBy("orderBy-1207110587")
1339    *           .setReadMask(FieldMask.newBuilder().build())
1340    *           .build();
1341    *   while (true) {
1342    *     ListPipelineJobsResponse response =
1343    *         pipelineServiceClient.listPipelineJobsCallable().call(request);
1344    *     for (PipelineJob element : response.getPipelineJobsList()) {
1345    *       // doThingsWith(element);
1346    *     }
1347    *     String nextPageToken = response.getNextPageToken();
1348    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1349    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1350    *     } else {
1351    *       break;
1352    *     }
1353    *   }
1354    * }
1355    * }</pre>
1356    */
1357   public final UnaryCallable<ListPipelineJobsRequest, ListPipelineJobsResponse>
listPipelineJobsCallable()1358       listPipelineJobsCallable() {
1359     return stub.listPipelineJobsCallable();
1360   }
1361 
1362   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1363   /**
1364    * Deletes a PipelineJob.
1365    *
1366    * <p>Sample code:
1367    *
1368    * <pre>{@code
1369    * // This snippet has been automatically generated and should be regarded as a code template only.
1370    * // It will require modifications to work:
1371    * // - It may require correct/in-range values for request initialization.
1372    * // - It may require specifying regional endpoints when creating the service client as shown in
1373    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1374    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1375    *   PipelineJobName name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]");
1376    *   pipelineServiceClient.deletePipelineJobAsync(name).get();
1377    * }
1378    * }</pre>
1379    *
1380    * @param name Required. The name of the PipelineJob resource to be deleted. Format:
1381    *     `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
1382    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1383    */
deletePipelineJobAsync( PipelineJobName name)1384   public final OperationFuture<Empty, DeleteOperationMetadata> deletePipelineJobAsync(
1385       PipelineJobName name) {
1386     DeletePipelineJobRequest request =
1387         DeletePipelineJobRequest.newBuilder()
1388             .setName(name == null ? null : name.toString())
1389             .build();
1390     return deletePipelineJobAsync(request);
1391   }
1392 
1393   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1394   /**
1395    * Deletes a PipelineJob.
1396    *
1397    * <p>Sample code:
1398    *
1399    * <pre>{@code
1400    * // This snippet has been automatically generated and should be regarded as a code template only.
1401    * // It will require modifications to work:
1402    * // - It may require correct/in-range values for request initialization.
1403    * // - It may require specifying regional endpoints when creating the service client as shown in
1404    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1405    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1406    *   String name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString();
1407    *   pipelineServiceClient.deletePipelineJobAsync(name).get();
1408    * }
1409    * }</pre>
1410    *
1411    * @param name Required. The name of the PipelineJob resource to be deleted. Format:
1412    *     `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
1413    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1414    */
deletePipelineJobAsync(String name)1415   public final OperationFuture<Empty, DeleteOperationMetadata> deletePipelineJobAsync(String name) {
1416     DeletePipelineJobRequest request = DeletePipelineJobRequest.newBuilder().setName(name).build();
1417     return deletePipelineJobAsync(request);
1418   }
1419 
1420   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1421   /**
1422    * Deletes a PipelineJob.
1423    *
1424    * <p>Sample code:
1425    *
1426    * <pre>{@code
1427    * // This snippet has been automatically generated and should be regarded as a code template only.
1428    * // It will require modifications to work:
1429    * // - It may require correct/in-range values for request initialization.
1430    * // - It may require specifying regional endpoints when creating the service client as shown in
1431    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1432    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1433    *   DeletePipelineJobRequest request =
1434    *       DeletePipelineJobRequest.newBuilder()
1435    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1436    *           .build();
1437    *   pipelineServiceClient.deletePipelineJobAsync(request).get();
1438    * }
1439    * }</pre>
1440    *
1441    * @param request The request object containing all of the parameters for the API call.
1442    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1443    */
deletePipelineJobAsync( DeletePipelineJobRequest request)1444   public final OperationFuture<Empty, DeleteOperationMetadata> deletePipelineJobAsync(
1445       DeletePipelineJobRequest request) {
1446     return deletePipelineJobOperationCallable().futureCall(request);
1447   }
1448 
1449   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1450   /**
1451    * Deletes a PipelineJob.
1452    *
1453    * <p>Sample code:
1454    *
1455    * <pre>{@code
1456    * // This snippet has been automatically generated and should be regarded as a code template only.
1457    * // It will require modifications to work:
1458    * // - It may require correct/in-range values for request initialization.
1459    * // - It may require specifying regional endpoints when creating the service client as shown in
1460    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1461    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1462    *   DeletePipelineJobRequest request =
1463    *       DeletePipelineJobRequest.newBuilder()
1464    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1465    *           .build();
1466    *   OperationFuture<Empty, DeleteOperationMetadata> future =
1467    *       pipelineServiceClient.deletePipelineJobOperationCallable().futureCall(request);
1468    *   // Do something.
1469    *   future.get();
1470    * }
1471    * }</pre>
1472    */
1473   public final OperationCallable<DeletePipelineJobRequest, Empty, DeleteOperationMetadata>
deletePipelineJobOperationCallable()1474       deletePipelineJobOperationCallable() {
1475     return stub.deletePipelineJobOperationCallable();
1476   }
1477 
1478   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1479   /**
1480    * Deletes a PipelineJob.
1481    *
1482    * <p>Sample code:
1483    *
1484    * <pre>{@code
1485    * // This snippet has been automatically generated and should be regarded as a code template only.
1486    * // It will require modifications to work:
1487    * // - It may require correct/in-range values for request initialization.
1488    * // - It may require specifying regional endpoints when creating the service client as shown in
1489    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1490    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1491    *   DeletePipelineJobRequest request =
1492    *       DeletePipelineJobRequest.newBuilder()
1493    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1494    *           .build();
1495    *   ApiFuture<Operation> future =
1496    *       pipelineServiceClient.deletePipelineJobCallable().futureCall(request);
1497    *   // Do something.
1498    *   future.get();
1499    * }
1500    * }</pre>
1501    */
deletePipelineJobCallable()1502   public final UnaryCallable<DeletePipelineJobRequest, Operation> deletePipelineJobCallable() {
1503     return stub.deletePipelineJobCallable();
1504   }
1505 
1506   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1507   /**
1508    * Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a
1509    * best effort to cancel the pipeline, but success is not guaranteed. Clients can use
1510    * [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] or
1511    * other methods to check whether the cancellation succeeded or whether the pipeline completed
1512    * despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it
1513    * becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error]
1514    * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1515    * `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set
1516    * to `CANCELLED`.
1517    *
1518    * <p>Sample code:
1519    *
1520    * <pre>{@code
1521    * // This snippet has been automatically generated and should be regarded as a code template only.
1522    * // It will require modifications to work:
1523    * // - It may require correct/in-range values for request initialization.
1524    * // - It may require specifying regional endpoints when creating the service client as shown in
1525    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1526    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1527    *   PipelineJobName name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]");
1528    *   pipelineServiceClient.cancelPipelineJob(name);
1529    * }
1530    * }</pre>
1531    *
1532    * @param name Required. The name of the PipelineJob to cancel. Format:
1533    *     `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
1534    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1535    */
cancelPipelineJob(PipelineJobName name)1536   public final void cancelPipelineJob(PipelineJobName name) {
1537     CancelPipelineJobRequest request =
1538         CancelPipelineJobRequest.newBuilder()
1539             .setName(name == null ? null : name.toString())
1540             .build();
1541     cancelPipelineJob(request);
1542   }
1543 
1544   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1545   /**
1546    * Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a
1547    * best effort to cancel the pipeline, but success is not guaranteed. Clients can use
1548    * [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] or
1549    * other methods to check whether the cancellation succeeded or whether the pipeline completed
1550    * despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it
1551    * becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error]
1552    * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1553    * `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set
1554    * to `CANCELLED`.
1555    *
1556    * <p>Sample code:
1557    *
1558    * <pre>{@code
1559    * // This snippet has been automatically generated and should be regarded as a code template only.
1560    * // It will require modifications to work:
1561    * // - It may require correct/in-range values for request initialization.
1562    * // - It may require specifying regional endpoints when creating the service client as shown in
1563    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1564    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1565    *   String name = PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString();
1566    *   pipelineServiceClient.cancelPipelineJob(name);
1567    * }
1568    * }</pre>
1569    *
1570    * @param name Required. The name of the PipelineJob to cancel. Format:
1571    *     `projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}`
1572    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1573    */
cancelPipelineJob(String name)1574   public final void cancelPipelineJob(String name) {
1575     CancelPipelineJobRequest request = CancelPipelineJobRequest.newBuilder().setName(name).build();
1576     cancelPipelineJob(request);
1577   }
1578 
1579   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1580   /**
1581    * Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a
1582    * best effort to cancel the pipeline, but success is not guaranteed. Clients can use
1583    * [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] or
1584    * other methods to check whether the cancellation succeeded or whether the pipeline completed
1585    * despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it
1586    * becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error]
1587    * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1588    * `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set
1589    * to `CANCELLED`.
1590    *
1591    * <p>Sample code:
1592    *
1593    * <pre>{@code
1594    * // This snippet has been automatically generated and should be regarded as a code template only.
1595    * // It will require modifications to work:
1596    * // - It may require correct/in-range values for request initialization.
1597    * // - It may require specifying regional endpoints when creating the service client as shown in
1598    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1599    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1600    *   CancelPipelineJobRequest request =
1601    *       CancelPipelineJobRequest.newBuilder()
1602    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1603    *           .build();
1604    *   pipelineServiceClient.cancelPipelineJob(request);
1605    * }
1606    * }</pre>
1607    *
1608    * @param request The request object containing all of the parameters for the API call.
1609    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1610    */
cancelPipelineJob(CancelPipelineJobRequest request)1611   public final void cancelPipelineJob(CancelPipelineJobRequest request) {
1612     cancelPipelineJobCallable().call(request);
1613   }
1614 
1615   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1616   /**
1617    * Cancels a PipelineJob. Starts asynchronous cancellation on the PipelineJob. The server makes a
1618    * best effort to cancel the pipeline, but success is not guaranteed. Clients can use
1619    * [PipelineService.GetPipelineJob][google.cloud.aiplatform.v1.PipelineService.GetPipelineJob] or
1620    * other methods to check whether the cancellation succeeded or whether the pipeline completed
1621    * despite cancellation. On successful cancellation, the PipelineJob is not deleted; instead it
1622    * becomes a pipeline with a [PipelineJob.error][google.cloud.aiplatform.v1.PipelineJob.error]
1623    * value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to
1624    * `Code.CANCELLED`, and [PipelineJob.state][google.cloud.aiplatform.v1.PipelineJob.state] is set
1625    * to `CANCELLED`.
1626    *
1627    * <p>Sample code:
1628    *
1629    * <pre>{@code
1630    * // This snippet has been automatically generated and should be regarded as a code template only.
1631    * // It will require modifications to work:
1632    * // - It may require correct/in-range values for request initialization.
1633    * // - It may require specifying regional endpoints when creating the service client as shown in
1634    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1635    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1636    *   CancelPipelineJobRequest request =
1637    *       CancelPipelineJobRequest.newBuilder()
1638    *           .setName(PipelineJobName.of("[PROJECT]", "[LOCATION]", "[PIPELINE_JOB]").toString())
1639    *           .build();
1640    *   ApiFuture<Empty> future =
1641    *       pipelineServiceClient.cancelPipelineJobCallable().futureCall(request);
1642    *   // Do something.
1643    *   future.get();
1644    * }
1645    * }</pre>
1646    */
cancelPipelineJobCallable()1647   public final UnaryCallable<CancelPipelineJobRequest, Empty> cancelPipelineJobCallable() {
1648     return stub.cancelPipelineJobCallable();
1649   }
1650 
1651   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1652   /**
1653    * Lists information about the supported locations for this service.
1654    *
1655    * <p>Sample code:
1656    *
1657    * <pre>{@code
1658    * // This snippet has been automatically generated and should be regarded as a code template only.
1659    * // It will require modifications to work:
1660    * // - It may require correct/in-range values for request initialization.
1661    * // - It may require specifying regional endpoints when creating the service client as shown in
1662    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1663    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1664    *   ListLocationsRequest request =
1665    *       ListLocationsRequest.newBuilder()
1666    *           .setName("name3373707")
1667    *           .setFilter("filter-1274492040")
1668    *           .setPageSize(883849137)
1669    *           .setPageToken("pageToken873572522")
1670    *           .build();
1671    *   for (Location element : pipelineServiceClient.listLocations(request).iterateAll()) {
1672    *     // doThingsWith(element);
1673    *   }
1674    * }
1675    * }</pre>
1676    *
1677    * @param request The request object containing all of the parameters for the API call.
1678    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1679    */
listLocations(ListLocationsRequest request)1680   public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
1681     return listLocationsPagedCallable().call(request);
1682   }
1683 
1684   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1685   /**
1686    * Lists information about the supported locations for this service.
1687    *
1688    * <p>Sample code:
1689    *
1690    * <pre>{@code
1691    * // This snippet has been automatically generated and should be regarded as a code template only.
1692    * // It will require modifications to work:
1693    * // - It may require correct/in-range values for request initialization.
1694    * // - It may require specifying regional endpoints when creating the service client as shown in
1695    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1696    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1697    *   ListLocationsRequest request =
1698    *       ListLocationsRequest.newBuilder()
1699    *           .setName("name3373707")
1700    *           .setFilter("filter-1274492040")
1701    *           .setPageSize(883849137)
1702    *           .setPageToken("pageToken873572522")
1703    *           .build();
1704    *   ApiFuture<Location> future =
1705    *       pipelineServiceClient.listLocationsPagedCallable().futureCall(request);
1706    *   // Do something.
1707    *   for (Location element : future.get().iterateAll()) {
1708    *     // doThingsWith(element);
1709    *   }
1710    * }
1711    * }</pre>
1712    */
1713   public final UnaryCallable<ListLocationsRequest, ListLocationsPagedResponse>
listLocationsPagedCallable()1714       listLocationsPagedCallable() {
1715     return stub.listLocationsPagedCallable();
1716   }
1717 
1718   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1719   /**
1720    * Lists information about the supported locations for this service.
1721    *
1722    * <p>Sample code:
1723    *
1724    * <pre>{@code
1725    * // This snippet has been automatically generated and should be regarded as a code template only.
1726    * // It will require modifications to work:
1727    * // - It may require correct/in-range values for request initialization.
1728    * // - It may require specifying regional endpoints when creating the service client as shown in
1729    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1730    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1731    *   ListLocationsRequest request =
1732    *       ListLocationsRequest.newBuilder()
1733    *           .setName("name3373707")
1734    *           .setFilter("filter-1274492040")
1735    *           .setPageSize(883849137)
1736    *           .setPageToken("pageToken873572522")
1737    *           .build();
1738    *   while (true) {
1739    *     ListLocationsResponse response =
1740    *         pipelineServiceClient.listLocationsCallable().call(request);
1741    *     for (Location element : response.getLocationsList()) {
1742    *       // doThingsWith(element);
1743    *     }
1744    *     String nextPageToken = response.getNextPageToken();
1745    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1746    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1747    *     } else {
1748    *       break;
1749    *     }
1750    *   }
1751    * }
1752    * }</pre>
1753    */
listLocationsCallable()1754   public final UnaryCallable<ListLocationsRequest, ListLocationsResponse> listLocationsCallable() {
1755     return stub.listLocationsCallable();
1756   }
1757 
1758   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1759   /**
1760    * Gets information about a location.
1761    *
1762    * <p>Sample code:
1763    *
1764    * <pre>{@code
1765    * // This snippet has been automatically generated and should be regarded as a code template only.
1766    * // It will require modifications to work:
1767    * // - It may require correct/in-range values for request initialization.
1768    * // - It may require specifying regional endpoints when creating the service client as shown in
1769    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1770    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1771    *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
1772    *   Location response = pipelineServiceClient.getLocation(request);
1773    * }
1774    * }</pre>
1775    *
1776    * @param request The request object containing all of the parameters for the API call.
1777    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1778    */
getLocation(GetLocationRequest request)1779   public final Location getLocation(GetLocationRequest request) {
1780     return getLocationCallable().call(request);
1781   }
1782 
1783   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1784   /**
1785    * Gets information about a location.
1786    *
1787    * <p>Sample code:
1788    *
1789    * <pre>{@code
1790    * // This snippet has been automatically generated and should be regarded as a code template only.
1791    * // It will require modifications to work:
1792    * // - It may require correct/in-range values for request initialization.
1793    * // - It may require specifying regional endpoints when creating the service client as shown in
1794    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1795    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1796    *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
1797    *   ApiFuture<Location> future = pipelineServiceClient.getLocationCallable().futureCall(request);
1798    *   // Do something.
1799    *   Location response = future.get();
1800    * }
1801    * }</pre>
1802    */
getLocationCallable()1803   public final UnaryCallable<GetLocationRequest, Location> getLocationCallable() {
1804     return stub.getLocationCallable();
1805   }
1806 
1807   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1808   /**
1809    * Sets the access control policy on the specified resource. Replacesany existing policy.
1810    *
1811    * <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
1812    *
1813    * <p>Sample code:
1814    *
1815    * <pre>{@code
1816    * // This snippet has been automatically generated and should be regarded as a code template only.
1817    * // It will require modifications to work:
1818    * // - It may require correct/in-range values for request initialization.
1819    * // - It may require specifying regional endpoints when creating the service client as shown in
1820    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1821    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1822    *   SetIamPolicyRequest request =
1823    *       SetIamPolicyRequest.newBuilder()
1824    *           .setResource(
1825    *               EndpointName.ofProjectLocationEndpointName(
1826    *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
1827    *                   .toString())
1828    *           .setPolicy(Policy.newBuilder().build())
1829    *           .setUpdateMask(FieldMask.newBuilder().build())
1830    *           .build();
1831    *   Policy response = pipelineServiceClient.setIamPolicy(request);
1832    * }
1833    * }</pre>
1834    *
1835    * @param request The request object containing all of the parameters for the API call.
1836    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1837    */
setIamPolicy(SetIamPolicyRequest request)1838   public final Policy setIamPolicy(SetIamPolicyRequest request) {
1839     return setIamPolicyCallable().call(request);
1840   }
1841 
1842   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1843   /**
1844    * Sets the access control policy on the specified resource. Replacesany existing policy.
1845    *
1846    * <p>Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
1847    *
1848    * <p>Sample code:
1849    *
1850    * <pre>{@code
1851    * // This snippet has been automatically generated and should be regarded as a code template only.
1852    * // It will require modifications to work:
1853    * // - It may require correct/in-range values for request initialization.
1854    * // - It may require specifying regional endpoints when creating the service client as shown in
1855    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1856    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1857    *   SetIamPolicyRequest request =
1858    *       SetIamPolicyRequest.newBuilder()
1859    *           .setResource(
1860    *               EndpointName.ofProjectLocationEndpointName(
1861    *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
1862    *                   .toString())
1863    *           .setPolicy(Policy.newBuilder().build())
1864    *           .setUpdateMask(FieldMask.newBuilder().build())
1865    *           .build();
1866    *   ApiFuture<Policy> future = pipelineServiceClient.setIamPolicyCallable().futureCall(request);
1867    *   // Do something.
1868    *   Policy response = future.get();
1869    * }
1870    * }</pre>
1871    */
setIamPolicyCallable()1872   public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
1873     return stub.setIamPolicyCallable();
1874   }
1875 
1876   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1877   /**
1878    * Gets the access control policy for a resource. Returns an empty policyif the resource exists
1879    * and does not have a policy set.
1880    *
1881    * <p>Sample code:
1882    *
1883    * <pre>{@code
1884    * // This snippet has been automatically generated and should be regarded as a code template only.
1885    * // It will require modifications to work:
1886    * // - It may require correct/in-range values for request initialization.
1887    * // - It may require specifying regional endpoints when creating the service client as shown in
1888    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1889    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1890    *   GetIamPolicyRequest request =
1891    *       GetIamPolicyRequest.newBuilder()
1892    *           .setResource(
1893    *               EndpointName.ofProjectLocationEndpointName(
1894    *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
1895    *                   .toString())
1896    *           .setOptions(GetPolicyOptions.newBuilder().build())
1897    *           .build();
1898    *   Policy response = pipelineServiceClient.getIamPolicy(request);
1899    * }
1900    * }</pre>
1901    *
1902    * @param request The request object containing all of the parameters for the API call.
1903    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1904    */
getIamPolicy(GetIamPolicyRequest request)1905   public final Policy getIamPolicy(GetIamPolicyRequest request) {
1906     return getIamPolicyCallable().call(request);
1907   }
1908 
1909   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1910   /**
1911    * Gets the access control policy for a resource. Returns an empty policyif the resource exists
1912    * and does not have a policy set.
1913    *
1914    * <p>Sample code:
1915    *
1916    * <pre>{@code
1917    * // This snippet has been automatically generated and should be regarded as a code template only.
1918    * // It will require modifications to work:
1919    * // - It may require correct/in-range values for request initialization.
1920    * // - It may require specifying regional endpoints when creating the service client as shown in
1921    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1922    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1923    *   GetIamPolicyRequest request =
1924    *       GetIamPolicyRequest.newBuilder()
1925    *           .setResource(
1926    *               EndpointName.ofProjectLocationEndpointName(
1927    *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
1928    *                   .toString())
1929    *           .setOptions(GetPolicyOptions.newBuilder().build())
1930    *           .build();
1931    *   ApiFuture<Policy> future = pipelineServiceClient.getIamPolicyCallable().futureCall(request);
1932    *   // Do something.
1933    *   Policy response = future.get();
1934    * }
1935    * }</pre>
1936    */
getIamPolicyCallable()1937   public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
1938     return stub.getIamPolicyCallable();
1939   }
1940 
1941   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1942   /**
1943    * Returns permissions that a caller has on the specified resource. If theresource does not exist,
1944    * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
1945    *
1946    * <p>Note: This operation is designed to be used for buildingpermission-aware UIs and
1947    * command-line tools, not for authorizationchecking. This operation may "fail open" without
1948    * warning.
1949    *
1950    * <p>Sample code:
1951    *
1952    * <pre>{@code
1953    * // This snippet has been automatically generated and should be regarded as a code template only.
1954    * // It will require modifications to work:
1955    * // - It may require correct/in-range values for request initialization.
1956    * // - It may require specifying regional endpoints when creating the service client as shown in
1957    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1958    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1959    *   TestIamPermissionsRequest request =
1960    *       TestIamPermissionsRequest.newBuilder()
1961    *           .setResource(
1962    *               EndpointName.ofProjectLocationEndpointName(
1963    *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
1964    *                   .toString())
1965    *           .addAllPermissions(new ArrayList<String>())
1966    *           .build();
1967    *   TestIamPermissionsResponse response = pipelineServiceClient.testIamPermissions(request);
1968    * }
1969    * }</pre>
1970    *
1971    * @param request The request object containing all of the parameters for the API call.
1972    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1973    */
testIamPermissions(TestIamPermissionsRequest request)1974   public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request) {
1975     return testIamPermissionsCallable().call(request);
1976   }
1977 
1978   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1979   /**
1980    * Returns permissions that a caller has on the specified resource. If theresource does not exist,
1981    * this will return an empty set ofpermissions, not a `NOT_FOUND` error.
1982    *
1983    * <p>Note: This operation is designed to be used for buildingpermission-aware UIs and
1984    * command-line tools, not for authorizationchecking. This operation may "fail open" without
1985    * warning.
1986    *
1987    * <p>Sample code:
1988    *
1989    * <pre>{@code
1990    * // This snippet has been automatically generated and should be regarded as a code template only.
1991    * // It will require modifications to work:
1992    * // - It may require correct/in-range values for request initialization.
1993    * // - It may require specifying regional endpoints when creating the service client as shown in
1994    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1995    * try (PipelineServiceClient pipelineServiceClient = PipelineServiceClient.create()) {
1996    *   TestIamPermissionsRequest request =
1997    *       TestIamPermissionsRequest.newBuilder()
1998    *           .setResource(
1999    *               EndpointName.ofProjectLocationEndpointName(
2000    *                       "[PROJECT]", "[LOCATION]", "[ENDPOINT]")
2001    *                   .toString())
2002    *           .addAllPermissions(new ArrayList<String>())
2003    *           .build();
2004    *   ApiFuture<TestIamPermissionsResponse> future =
2005    *       pipelineServiceClient.testIamPermissionsCallable().futureCall(request);
2006    *   // Do something.
2007    *   TestIamPermissionsResponse response = future.get();
2008    * }
2009    * }</pre>
2010    */
2011   public final UnaryCallable<TestIamPermissionsRequest, TestIamPermissionsResponse>
testIamPermissionsCallable()2012       testIamPermissionsCallable() {
2013     return stub.testIamPermissionsCallable();
2014   }
2015 
2016   @Override
close()2017   public final void close() {
2018     stub.close();
2019   }
2020 
2021   @Override
shutdown()2022   public void shutdown() {
2023     stub.shutdown();
2024   }
2025 
2026   @Override
isShutdown()2027   public boolean isShutdown() {
2028     return stub.isShutdown();
2029   }
2030 
2031   @Override
isTerminated()2032   public boolean isTerminated() {
2033     return stub.isTerminated();
2034   }
2035 
2036   @Override
shutdownNow()2037   public void shutdownNow() {
2038     stub.shutdownNow();
2039   }
2040 
2041   @Override
awaitTermination(long duration, TimeUnit unit)2042   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
2043     return stub.awaitTermination(duration, unit);
2044   }
2045 
2046   public static class ListTrainingPipelinesPagedResponse
2047       extends AbstractPagedListResponse<
2048           ListTrainingPipelinesRequest,
2049           ListTrainingPipelinesResponse,
2050           TrainingPipeline,
2051           ListTrainingPipelinesPage,
2052           ListTrainingPipelinesFixedSizeCollection> {
2053 
createAsync( PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline> context, ApiFuture<ListTrainingPipelinesResponse> futureResponse)2054     public static ApiFuture<ListTrainingPipelinesPagedResponse> createAsync(
2055         PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline>
2056             context,
2057         ApiFuture<ListTrainingPipelinesResponse> futureResponse) {
2058       ApiFuture<ListTrainingPipelinesPage> futurePage =
2059           ListTrainingPipelinesPage.createEmptyPage().createPageAsync(context, futureResponse);
2060       return ApiFutures.transform(
2061           futurePage,
2062           input -> new ListTrainingPipelinesPagedResponse(input),
2063           MoreExecutors.directExecutor());
2064     }
2065 
ListTrainingPipelinesPagedResponse(ListTrainingPipelinesPage page)2066     private ListTrainingPipelinesPagedResponse(ListTrainingPipelinesPage page) {
2067       super(page, ListTrainingPipelinesFixedSizeCollection.createEmptyCollection());
2068     }
2069   }
2070 
2071   public static class ListTrainingPipelinesPage
2072       extends AbstractPage<
2073           ListTrainingPipelinesRequest,
2074           ListTrainingPipelinesResponse,
2075           TrainingPipeline,
2076           ListTrainingPipelinesPage> {
2077 
ListTrainingPipelinesPage( PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline> context, ListTrainingPipelinesResponse response)2078     private ListTrainingPipelinesPage(
2079         PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline>
2080             context,
2081         ListTrainingPipelinesResponse response) {
2082       super(context, response);
2083     }
2084 
createEmptyPage()2085     private static ListTrainingPipelinesPage createEmptyPage() {
2086       return new ListTrainingPipelinesPage(null, null);
2087     }
2088 
2089     @Override
createPage( PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline> context, ListTrainingPipelinesResponse response)2090     protected ListTrainingPipelinesPage createPage(
2091         PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline>
2092             context,
2093         ListTrainingPipelinesResponse response) {
2094       return new ListTrainingPipelinesPage(context, response);
2095     }
2096 
2097     @Override
createPageAsync( PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline> context, ApiFuture<ListTrainingPipelinesResponse> futureResponse)2098     public ApiFuture<ListTrainingPipelinesPage> createPageAsync(
2099         PageContext<ListTrainingPipelinesRequest, ListTrainingPipelinesResponse, TrainingPipeline>
2100             context,
2101         ApiFuture<ListTrainingPipelinesResponse> futureResponse) {
2102       return super.createPageAsync(context, futureResponse);
2103     }
2104   }
2105 
2106   public static class ListTrainingPipelinesFixedSizeCollection
2107       extends AbstractFixedSizeCollection<
2108           ListTrainingPipelinesRequest,
2109           ListTrainingPipelinesResponse,
2110           TrainingPipeline,
2111           ListTrainingPipelinesPage,
2112           ListTrainingPipelinesFixedSizeCollection> {
2113 
ListTrainingPipelinesFixedSizeCollection( List<ListTrainingPipelinesPage> pages, int collectionSize)2114     private ListTrainingPipelinesFixedSizeCollection(
2115         List<ListTrainingPipelinesPage> pages, int collectionSize) {
2116       super(pages, collectionSize);
2117     }
2118 
createEmptyCollection()2119     private static ListTrainingPipelinesFixedSizeCollection createEmptyCollection() {
2120       return new ListTrainingPipelinesFixedSizeCollection(null, 0);
2121     }
2122 
2123     @Override
createCollection( List<ListTrainingPipelinesPage> pages, int collectionSize)2124     protected ListTrainingPipelinesFixedSizeCollection createCollection(
2125         List<ListTrainingPipelinesPage> pages, int collectionSize) {
2126       return new ListTrainingPipelinesFixedSizeCollection(pages, collectionSize);
2127     }
2128   }
2129 
2130   public static class ListPipelineJobsPagedResponse
2131       extends AbstractPagedListResponse<
2132           ListPipelineJobsRequest,
2133           ListPipelineJobsResponse,
2134           PipelineJob,
2135           ListPipelineJobsPage,
2136           ListPipelineJobsFixedSizeCollection> {
2137 
createAsync( PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context, ApiFuture<ListPipelineJobsResponse> futureResponse)2138     public static ApiFuture<ListPipelineJobsPagedResponse> createAsync(
2139         PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context,
2140         ApiFuture<ListPipelineJobsResponse> futureResponse) {
2141       ApiFuture<ListPipelineJobsPage> futurePage =
2142           ListPipelineJobsPage.createEmptyPage().createPageAsync(context, futureResponse);
2143       return ApiFutures.transform(
2144           futurePage,
2145           input -> new ListPipelineJobsPagedResponse(input),
2146           MoreExecutors.directExecutor());
2147     }
2148 
ListPipelineJobsPagedResponse(ListPipelineJobsPage page)2149     private ListPipelineJobsPagedResponse(ListPipelineJobsPage page) {
2150       super(page, ListPipelineJobsFixedSizeCollection.createEmptyCollection());
2151     }
2152   }
2153 
2154   public static class ListPipelineJobsPage
2155       extends AbstractPage<
2156           ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob, ListPipelineJobsPage> {
2157 
ListPipelineJobsPage( PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context, ListPipelineJobsResponse response)2158     private ListPipelineJobsPage(
2159         PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context,
2160         ListPipelineJobsResponse response) {
2161       super(context, response);
2162     }
2163 
createEmptyPage()2164     private static ListPipelineJobsPage createEmptyPage() {
2165       return new ListPipelineJobsPage(null, null);
2166     }
2167 
2168     @Override
createPage( PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context, ListPipelineJobsResponse response)2169     protected ListPipelineJobsPage createPage(
2170         PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context,
2171         ListPipelineJobsResponse response) {
2172       return new ListPipelineJobsPage(context, response);
2173     }
2174 
2175     @Override
createPageAsync( PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context, ApiFuture<ListPipelineJobsResponse> futureResponse)2176     public ApiFuture<ListPipelineJobsPage> createPageAsync(
2177         PageContext<ListPipelineJobsRequest, ListPipelineJobsResponse, PipelineJob> context,
2178         ApiFuture<ListPipelineJobsResponse> futureResponse) {
2179       return super.createPageAsync(context, futureResponse);
2180     }
2181   }
2182 
2183   public static class ListPipelineJobsFixedSizeCollection
2184       extends AbstractFixedSizeCollection<
2185           ListPipelineJobsRequest,
2186           ListPipelineJobsResponse,
2187           PipelineJob,
2188           ListPipelineJobsPage,
2189           ListPipelineJobsFixedSizeCollection> {
2190 
ListPipelineJobsFixedSizeCollection( List<ListPipelineJobsPage> pages, int collectionSize)2191     private ListPipelineJobsFixedSizeCollection(
2192         List<ListPipelineJobsPage> pages, int collectionSize) {
2193       super(pages, collectionSize);
2194     }
2195 
createEmptyCollection()2196     private static ListPipelineJobsFixedSizeCollection createEmptyCollection() {
2197       return new ListPipelineJobsFixedSizeCollection(null, 0);
2198     }
2199 
2200     @Override
createCollection( List<ListPipelineJobsPage> pages, int collectionSize)2201     protected ListPipelineJobsFixedSizeCollection createCollection(
2202         List<ListPipelineJobsPage> pages, int collectionSize) {
2203       return new ListPipelineJobsFixedSizeCollection(pages, collectionSize);
2204     }
2205   }
2206 
2207   public static class ListLocationsPagedResponse
2208       extends AbstractPagedListResponse<
2209           ListLocationsRequest,
2210           ListLocationsResponse,
2211           Location,
2212           ListLocationsPage,
2213           ListLocationsFixedSizeCollection> {
2214 
createAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)2215     public static ApiFuture<ListLocationsPagedResponse> createAsync(
2216         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2217         ApiFuture<ListLocationsResponse> futureResponse) {
2218       ApiFuture<ListLocationsPage> futurePage =
2219           ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
2220       return ApiFutures.transform(
2221           futurePage,
2222           input -> new ListLocationsPagedResponse(input),
2223           MoreExecutors.directExecutor());
2224     }
2225 
ListLocationsPagedResponse(ListLocationsPage page)2226     private ListLocationsPagedResponse(ListLocationsPage page) {
2227       super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
2228     }
2229   }
2230 
2231   public static class ListLocationsPage
2232       extends AbstractPage<
2233           ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
2234 
ListLocationsPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)2235     private ListLocationsPage(
2236         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2237         ListLocationsResponse response) {
2238       super(context, response);
2239     }
2240 
createEmptyPage()2241     private static ListLocationsPage createEmptyPage() {
2242       return new ListLocationsPage(null, null);
2243     }
2244 
2245     @Override
createPage( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ListLocationsResponse response)2246     protected ListLocationsPage createPage(
2247         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2248         ListLocationsResponse response) {
2249       return new ListLocationsPage(context, response);
2250     }
2251 
2252     @Override
createPageAsync( PageContext<ListLocationsRequest, ListLocationsResponse, Location> context, ApiFuture<ListLocationsResponse> futureResponse)2253     public ApiFuture<ListLocationsPage> createPageAsync(
2254         PageContext<ListLocationsRequest, ListLocationsResponse, Location> context,
2255         ApiFuture<ListLocationsResponse> futureResponse) {
2256       return super.createPageAsync(context, futureResponse);
2257     }
2258   }
2259 
2260   public static class ListLocationsFixedSizeCollection
2261       extends AbstractFixedSizeCollection<
2262           ListLocationsRequest,
2263           ListLocationsResponse,
2264           Location,
2265           ListLocationsPage,
2266           ListLocationsFixedSizeCollection> {
2267 
ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize)2268     private ListLocationsFixedSizeCollection(List<ListLocationsPage> pages, int collectionSize) {
2269       super(pages, collectionSize);
2270     }
2271 
createEmptyCollection()2272     private static ListLocationsFixedSizeCollection createEmptyCollection() {
2273       return new ListLocationsFixedSizeCollection(null, 0);
2274     }
2275 
2276     @Override
createCollection( List<ListLocationsPage> pages, int collectionSize)2277     protected ListLocationsFixedSizeCollection createCollection(
2278         List<ListLocationsPage> pages, int collectionSize) {
2279       return new ListLocationsFixedSizeCollection(pages, collectionSize);
2280     }
2281   }
2282 }
2283