• 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.compute.v1;
18 
19 import com.google.api.core.ApiFuture;
20 import com.google.api.core.ApiFutures;
21 import com.google.api.core.BetaApi;
22 import com.google.api.gax.core.BackgroundResource;
23 import com.google.api.gax.longrunning.OperationFuture;
24 import com.google.api.gax.paging.AbstractFixedSizeCollection;
25 import com.google.api.gax.paging.AbstractPage;
26 import com.google.api.gax.paging.AbstractPagedListResponse;
27 import com.google.api.gax.rpc.OperationCallable;
28 import com.google.api.gax.rpc.PageContext;
29 import com.google.api.gax.rpc.UnaryCallable;
30 import com.google.cloud.compute.v1.stub.InstanceGroupManagersStub;
31 import com.google.cloud.compute.v1.stub.InstanceGroupManagersStubSettings;
32 import com.google.common.util.concurrent.MoreExecutors;
33 import java.io.IOException;
34 import java.util.List;
35 import java.util.Map;
36 import java.util.concurrent.TimeUnit;
37 import javax.annotation.Generated;
38 
39 // AUTO-GENERATED DOCUMENTATION AND CLASS.
40 /**
41  * Service Description: The InstanceGroupManagers API.
42  *
43  * <p>This class provides the ability to make remote calls to the backing service through method
44  * calls that map to API methods. Sample code to get started:
45  *
46  * <pre>{@code
47  * // This snippet has been automatically generated and should be regarded as a code template only.
48  * // It will require modifications to work:
49  * // - It may require correct/in-range values for request initialization.
50  * // - It may require specifying regional endpoints when creating the service client as shown in
51  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
52  * try (InstanceGroupManagersClient instanceGroupManagersClient =
53  *     InstanceGroupManagersClient.create()) {
54  *   String project = "project-309310695";
55  *   String zone = "zone3744684";
56  *   String instanceGroupManager = "instanceGroupManager-388242077";
57  *   InstanceGroupManager response =
58  *       instanceGroupManagersClient.get(project, zone, instanceGroupManager);
59  * }
60  * }</pre>
61  *
62  * <p>Note: close() needs to be called on the InstanceGroupManagersClient object to clean up
63  * resources such as threads. In the example above, try-with-resources is used, which automatically
64  * calls close().
65  *
66  * <p>The surface of this class includes several types of Java methods for each of the API's
67  * methods:
68  *
69  * <ol>
70  *   <li>A "flattened" method. With this type of method, the fields of the request type have been
71  *       converted into function parameters. It may be the case that not all fields are available as
72  *       parameters, and not every API method will have a flattened method entry point.
73  *   <li>A "request object" method. This type of method only takes one parameter, a request object,
74  *       which must be constructed before the call. Not every API method will have a request object
75  *       method.
76  *   <li>A "callable" method. This type of method takes no parameters and returns an immutable API
77  *       callable object, which can be used to initiate calls to the service.
78  * </ol>
79  *
80  * <p>See the individual methods for example code.
81  *
82  * <p>Many parameters require resource names to be formatted in a particular way. To assist with
83  * these names, this class includes a format method for each type of name, and additionally a parse
84  * method to extract the individual identifiers contained within names that are returned.
85  *
86  * <p>This class can be customized by passing in a custom instance of InstanceGroupManagersSettings
87  * to create(). For example:
88  *
89  * <p>To customize credentials:
90  *
91  * <pre>{@code
92  * // This snippet has been automatically generated and should be regarded as a code template only.
93  * // It will require modifications to work:
94  * // - It may require correct/in-range values for request initialization.
95  * // - It may require specifying regional endpoints when creating the service client as shown in
96  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
97  * InstanceGroupManagersSettings instanceGroupManagersSettings =
98  *     InstanceGroupManagersSettings.newBuilder()
99  *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
100  *         .build();
101  * InstanceGroupManagersClient instanceGroupManagersClient =
102  *     InstanceGroupManagersClient.create(instanceGroupManagersSettings);
103  * }</pre>
104  *
105  * <p>To customize the endpoint:
106  *
107  * <pre>{@code
108  * // This snippet has been automatically generated and should be regarded as a code template only.
109  * // It will require modifications to work:
110  * // - It may require correct/in-range values for request initialization.
111  * // - It may require specifying regional endpoints when creating the service client as shown in
112  * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
113  * InstanceGroupManagersSettings instanceGroupManagersSettings =
114  *     InstanceGroupManagersSettings.newBuilder().setEndpoint(myEndpoint).build();
115  * InstanceGroupManagersClient instanceGroupManagersClient =
116  *     InstanceGroupManagersClient.create(instanceGroupManagersSettings);
117  * }</pre>
118  *
119  * <p>Please refer to the GitHub repository's samples for more quickstart code snippets.
120  */
121 @Generated("by gapic-generator-java")
122 public class InstanceGroupManagersClient implements BackgroundResource {
123   private final InstanceGroupManagersSettings settings;
124   private final InstanceGroupManagersStub stub;
125 
126   /** Constructs an instance of InstanceGroupManagersClient with default settings. */
create()127   public static final InstanceGroupManagersClient create() throws IOException {
128     return create(InstanceGroupManagersSettings.newBuilder().build());
129   }
130 
131   /**
132    * Constructs an instance of InstanceGroupManagersClient, using the given settings. The channels
133    * are created based on the settings passed in, or defaults for any settings that are not set.
134    */
create(InstanceGroupManagersSettings settings)135   public static final InstanceGroupManagersClient create(InstanceGroupManagersSettings settings)
136       throws IOException {
137     return new InstanceGroupManagersClient(settings);
138   }
139 
140   /**
141    * Constructs an instance of InstanceGroupManagersClient, using the given stub for making calls.
142    * This is for advanced usage - prefer using create(InstanceGroupManagersSettings).
143    */
create(InstanceGroupManagersStub stub)144   public static final InstanceGroupManagersClient create(InstanceGroupManagersStub stub) {
145     return new InstanceGroupManagersClient(stub);
146   }
147 
148   /**
149    * Constructs an instance of InstanceGroupManagersClient, using the given settings. This is
150    * protected so that it is easy to make a subclass, but otherwise, the static factory methods
151    * should be preferred.
152    */
InstanceGroupManagersClient(InstanceGroupManagersSettings settings)153   protected InstanceGroupManagersClient(InstanceGroupManagersSettings settings) throws IOException {
154     this.settings = settings;
155     this.stub = ((InstanceGroupManagersStubSettings) settings.getStubSettings()).createStub();
156   }
157 
InstanceGroupManagersClient(InstanceGroupManagersStub stub)158   protected InstanceGroupManagersClient(InstanceGroupManagersStub stub) {
159     this.settings = null;
160     this.stub = stub;
161   }
162 
getSettings()163   public final InstanceGroupManagersSettings getSettings() {
164     return settings;
165   }
166 
getStub()167   public InstanceGroupManagersStub getStub() {
168     return stub;
169   }
170 
171   // AUTO-GENERATED DOCUMENTATION AND METHOD.
172   /**
173    * Flags the specified instances to be removed from the managed instance group. Abandoning an
174    * instance does not delete the instance, but it does remove the instance from any target pools
175    * that are applied by the managed instance group. This method reduces the targetSize of the
176    * managed instance group by the number of instances that you abandon. This operation is marked as
177    * DONE when the action is scheduled even if the instances have not yet been removed from the
178    * group. You must separately verify the status of the abandoning action with the
179    * listmanagedinstances method. If the group is part of a backend service that has enabled
180    * connection draining, it can take up to 60 seconds after the connection draining duration has
181    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
182    * instances with this method per request.
183    *
184    * <p>Sample code:
185    *
186    * <pre>{@code
187    * // This snippet has been automatically generated and should be regarded as a code template only.
188    * // It will require modifications to work:
189    * // - It may require correct/in-range values for request initialization.
190    * // - It may require specifying regional endpoints when creating the service client as shown in
191    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
192    * try (InstanceGroupManagersClient instanceGroupManagersClient =
193    *     InstanceGroupManagersClient.create()) {
194    *   String project = "project-309310695";
195    *   String zone = "zone3744684";
196    *   String instanceGroupManager = "instanceGroupManager-388242077";
197    *   InstanceGroupManagersAbandonInstancesRequest
198    *       instanceGroupManagersAbandonInstancesRequestResource =
199    *           InstanceGroupManagersAbandonInstancesRequest.newBuilder().build();
200    *   Operation response =
201    *       instanceGroupManagersClient
202    *           .abandonInstancesAsync(
203    *               project,
204    *               zone,
205    *               instanceGroupManager,
206    *               instanceGroupManagersAbandonInstancesRequestResource)
207    *           .get();
208    * }
209    * }</pre>
210    *
211    * @param project Project ID for this request.
212    * @param zone The name of the zone where the managed instance group is located.
213    * @param instanceGroupManager The name of the managed instance group.
214    * @param instanceGroupManagersAbandonInstancesRequestResource The body resource for this request
215    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
216    */
abandonInstancesAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersAbandonInstancesRequest instanceGroupManagersAbandonInstancesRequestResource)217   public final OperationFuture<Operation, Operation> abandonInstancesAsync(
218       String project,
219       String zone,
220       String instanceGroupManager,
221       InstanceGroupManagersAbandonInstancesRequest
222           instanceGroupManagersAbandonInstancesRequestResource) {
223     AbandonInstancesInstanceGroupManagerRequest request =
224         AbandonInstancesInstanceGroupManagerRequest.newBuilder()
225             .setProject(project)
226             .setZone(zone)
227             .setInstanceGroupManager(instanceGroupManager)
228             .setInstanceGroupManagersAbandonInstancesRequestResource(
229                 instanceGroupManagersAbandonInstancesRequestResource)
230             .build();
231     return abandonInstancesAsync(request);
232   }
233 
234   // AUTO-GENERATED DOCUMENTATION AND METHOD.
235   /**
236    * Flags the specified instances to be removed from the managed instance group. Abandoning an
237    * instance does not delete the instance, but it does remove the instance from any target pools
238    * that are applied by the managed instance group. This method reduces the targetSize of the
239    * managed instance group by the number of instances that you abandon. This operation is marked as
240    * DONE when the action is scheduled even if the instances have not yet been removed from the
241    * group. You must separately verify the status of the abandoning action with the
242    * listmanagedinstances method. If the group is part of a backend service that has enabled
243    * connection draining, it can take up to 60 seconds after the connection draining duration has
244    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
245    * instances with this method per request.
246    *
247    * <p>Sample code:
248    *
249    * <pre>{@code
250    * // This snippet has been automatically generated and should be regarded as a code template only.
251    * // It will require modifications to work:
252    * // - It may require correct/in-range values for request initialization.
253    * // - It may require specifying regional endpoints when creating the service client as shown in
254    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
255    * try (InstanceGroupManagersClient instanceGroupManagersClient =
256    *     InstanceGroupManagersClient.create()) {
257    *   AbandonInstancesInstanceGroupManagerRequest request =
258    *       AbandonInstancesInstanceGroupManagerRequest.newBuilder()
259    *           .setInstanceGroupManager("instanceGroupManager-388242077")
260    *           .setInstanceGroupManagersAbandonInstancesRequestResource(
261    *               InstanceGroupManagersAbandonInstancesRequest.newBuilder().build())
262    *           .setProject("project-309310695")
263    *           .setRequestId("requestId693933066")
264    *           .setZone("zone3744684")
265    *           .build();
266    *   Operation response = instanceGroupManagersClient.abandonInstancesAsync(request).get();
267    * }
268    * }</pre>
269    *
270    * @param request The request object containing all of the parameters for the API call.
271    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
272    */
273   @BetaApi(
274       "The surface for long-running operations is not stable yet and may change in the future.")
abandonInstancesAsync( AbandonInstancesInstanceGroupManagerRequest request)275   public final OperationFuture<Operation, Operation> abandonInstancesAsync(
276       AbandonInstancesInstanceGroupManagerRequest request) {
277     return abandonInstancesOperationCallable().futureCall(request);
278   }
279 
280   // AUTO-GENERATED DOCUMENTATION AND METHOD.
281   /**
282    * Flags the specified instances to be removed from the managed instance group. Abandoning an
283    * instance does not delete the instance, but it does remove the instance from any target pools
284    * that are applied by the managed instance group. This method reduces the targetSize of the
285    * managed instance group by the number of instances that you abandon. This operation is marked as
286    * DONE when the action is scheduled even if the instances have not yet been removed from the
287    * group. You must separately verify the status of the abandoning action with the
288    * listmanagedinstances method. If the group is part of a backend service that has enabled
289    * connection draining, it can take up to 60 seconds after the connection draining duration has
290    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
291    * instances with this method per request.
292    *
293    * <p>Sample code:
294    *
295    * <pre>{@code
296    * // This snippet has been automatically generated and should be regarded as a code template only.
297    * // It will require modifications to work:
298    * // - It may require correct/in-range values for request initialization.
299    * // - It may require specifying regional endpoints when creating the service client as shown in
300    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
301    * try (InstanceGroupManagersClient instanceGroupManagersClient =
302    *     InstanceGroupManagersClient.create()) {
303    *   AbandonInstancesInstanceGroupManagerRequest request =
304    *       AbandonInstancesInstanceGroupManagerRequest.newBuilder()
305    *           .setInstanceGroupManager("instanceGroupManager-388242077")
306    *           .setInstanceGroupManagersAbandonInstancesRequestResource(
307    *               InstanceGroupManagersAbandonInstancesRequest.newBuilder().build())
308    *           .setProject("project-309310695")
309    *           .setRequestId("requestId693933066")
310    *           .setZone("zone3744684")
311    *           .build();
312    *   OperationFuture<Operation, Operation> future =
313    *       instanceGroupManagersClient.abandonInstancesOperationCallable().futureCall(request);
314    *   // Do something.
315    *   Operation response = future.get();
316    * }
317    * }</pre>
318    */
319   public final OperationCallable<AbandonInstancesInstanceGroupManagerRequest, Operation, Operation>
abandonInstancesOperationCallable()320       abandonInstancesOperationCallable() {
321     return stub.abandonInstancesOperationCallable();
322   }
323 
324   // AUTO-GENERATED DOCUMENTATION AND METHOD.
325   /**
326    * Flags the specified instances to be removed from the managed instance group. Abandoning an
327    * instance does not delete the instance, but it does remove the instance from any target pools
328    * that are applied by the managed instance group. This method reduces the targetSize of the
329    * managed instance group by the number of instances that you abandon. This operation is marked as
330    * DONE when the action is scheduled even if the instances have not yet been removed from the
331    * group. You must separately verify the status of the abandoning action with the
332    * listmanagedinstances method. If the group is part of a backend service that has enabled
333    * connection draining, it can take up to 60 seconds after the connection draining duration has
334    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
335    * instances with this method per request.
336    *
337    * <p>Sample code:
338    *
339    * <pre>{@code
340    * // This snippet has been automatically generated and should be regarded as a code template only.
341    * // It will require modifications to work:
342    * // - It may require correct/in-range values for request initialization.
343    * // - It may require specifying regional endpoints when creating the service client as shown in
344    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
345    * try (InstanceGroupManagersClient instanceGroupManagersClient =
346    *     InstanceGroupManagersClient.create()) {
347    *   AbandonInstancesInstanceGroupManagerRequest request =
348    *       AbandonInstancesInstanceGroupManagerRequest.newBuilder()
349    *           .setInstanceGroupManager("instanceGroupManager-388242077")
350    *           .setInstanceGroupManagersAbandonInstancesRequestResource(
351    *               InstanceGroupManagersAbandonInstancesRequest.newBuilder().build())
352    *           .setProject("project-309310695")
353    *           .setRequestId("requestId693933066")
354    *           .setZone("zone3744684")
355    *           .build();
356    *   ApiFuture<Operation> future =
357    *       instanceGroupManagersClient.abandonInstancesCallable().futureCall(request);
358    *   // Do something.
359    *   Operation response = future.get();
360    * }
361    * }</pre>
362    */
363   public final UnaryCallable<AbandonInstancesInstanceGroupManagerRequest, Operation>
abandonInstancesCallable()364       abandonInstancesCallable() {
365     return stub.abandonInstancesCallable();
366   }
367 
368   // AUTO-GENERATED DOCUMENTATION AND METHOD.
369   /**
370    * Retrieves the list of managed instance groups and groups them by zone.
371    *
372    * <p>Sample code:
373    *
374    * <pre>{@code
375    * // This snippet has been automatically generated and should be regarded as a code template only.
376    * // It will require modifications to work:
377    * // - It may require correct/in-range values for request initialization.
378    * // - It may require specifying regional endpoints when creating the service client as shown in
379    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
380    * try (InstanceGroupManagersClient instanceGroupManagersClient =
381    *     InstanceGroupManagersClient.create()) {
382    *   String project = "project-309310695";
383    *   for (Map.Entry<String, InstanceGroupManagersScopedList> element :
384    *       instanceGroupManagersClient.aggregatedList(project).iterateAll()) {
385    *     // doThingsWith(element);
386    *   }
387    * }
388    * }</pre>
389    *
390    * @param project Project ID for this request.
391    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
392    */
aggregatedList(String project)393   public final AggregatedListPagedResponse aggregatedList(String project) {
394     AggregatedListInstanceGroupManagersRequest request =
395         AggregatedListInstanceGroupManagersRequest.newBuilder().setProject(project).build();
396     return aggregatedList(request);
397   }
398 
399   // AUTO-GENERATED DOCUMENTATION AND METHOD.
400   /**
401    * Retrieves the list of managed instance groups and groups them by zone.
402    *
403    * <p>Sample code:
404    *
405    * <pre>{@code
406    * // This snippet has been automatically generated and should be regarded as a code template only.
407    * // It will require modifications to work:
408    * // - It may require correct/in-range values for request initialization.
409    * // - It may require specifying regional endpoints when creating the service client as shown in
410    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
411    * try (InstanceGroupManagersClient instanceGroupManagersClient =
412    *     InstanceGroupManagersClient.create()) {
413    *   AggregatedListInstanceGroupManagersRequest request =
414    *       AggregatedListInstanceGroupManagersRequest.newBuilder()
415    *           .setFilter("filter-1274492040")
416    *           .setIncludeAllScopes(true)
417    *           .setMaxResults(1128457243)
418    *           .setOrderBy("orderBy-1207110587")
419    *           .setPageToken("pageToken873572522")
420    *           .setProject("project-309310695")
421    *           .setReturnPartialSuccess(true)
422    *           .build();
423    *   for (Map.Entry<String, InstanceGroupManagersScopedList> element :
424    *       instanceGroupManagersClient.aggregatedList(request).iterateAll()) {
425    *     // doThingsWith(element);
426    *   }
427    * }
428    * }</pre>
429    *
430    * @param request The request object containing all of the parameters for the API call.
431    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
432    */
aggregatedList( AggregatedListInstanceGroupManagersRequest request)433   public final AggregatedListPagedResponse aggregatedList(
434       AggregatedListInstanceGroupManagersRequest request) {
435     return aggregatedListPagedCallable().call(request);
436   }
437 
438   // AUTO-GENERATED DOCUMENTATION AND METHOD.
439   /**
440    * Retrieves the list of managed instance groups and groups them by zone.
441    *
442    * <p>Sample code:
443    *
444    * <pre>{@code
445    * // This snippet has been automatically generated and should be regarded as a code template only.
446    * // It will require modifications to work:
447    * // - It may require correct/in-range values for request initialization.
448    * // - It may require specifying regional endpoints when creating the service client as shown in
449    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
450    * try (InstanceGroupManagersClient instanceGroupManagersClient =
451    *     InstanceGroupManagersClient.create()) {
452    *   AggregatedListInstanceGroupManagersRequest request =
453    *       AggregatedListInstanceGroupManagersRequest.newBuilder()
454    *           .setFilter("filter-1274492040")
455    *           .setIncludeAllScopes(true)
456    *           .setMaxResults(1128457243)
457    *           .setOrderBy("orderBy-1207110587")
458    *           .setPageToken("pageToken873572522")
459    *           .setProject("project-309310695")
460    *           .setReturnPartialSuccess(true)
461    *           .build();
462    *   ApiFuture<Map.Entry<String, InstanceGroupManagersScopedList>> future =
463    *       instanceGroupManagersClient.aggregatedListPagedCallable().futureCall(request);
464    *   // Do something.
465    *   for (Map.Entry<String, InstanceGroupManagersScopedList> element : future.get().iterateAll()) {
466    *     // doThingsWith(element);
467    *   }
468    * }
469    * }</pre>
470    */
471   public final UnaryCallable<
472           AggregatedListInstanceGroupManagersRequest, AggregatedListPagedResponse>
aggregatedListPagedCallable()473       aggregatedListPagedCallable() {
474     return stub.aggregatedListPagedCallable();
475   }
476 
477   // AUTO-GENERATED DOCUMENTATION AND METHOD.
478   /**
479    * Retrieves the list of managed instance groups and groups them by zone.
480    *
481    * <p>Sample code:
482    *
483    * <pre>{@code
484    * // This snippet has been automatically generated and should be regarded as a code template only.
485    * // It will require modifications to work:
486    * // - It may require correct/in-range values for request initialization.
487    * // - It may require specifying regional endpoints when creating the service client as shown in
488    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
489    * try (InstanceGroupManagersClient instanceGroupManagersClient =
490    *     InstanceGroupManagersClient.create()) {
491    *   AggregatedListInstanceGroupManagersRequest request =
492    *       AggregatedListInstanceGroupManagersRequest.newBuilder()
493    *           .setFilter("filter-1274492040")
494    *           .setIncludeAllScopes(true)
495    *           .setMaxResults(1128457243)
496    *           .setOrderBy("orderBy-1207110587")
497    *           .setPageToken("pageToken873572522")
498    *           .setProject("project-309310695")
499    *           .setReturnPartialSuccess(true)
500    *           .build();
501    *   while (true) {
502    *     InstanceGroupManagerAggregatedList response =
503    *         instanceGroupManagersClient.aggregatedListCallable().call(request);
504    *     for (Map.Entry<String, InstanceGroupManagersScopedList> element : response.getItemsList()) {
505    *       // doThingsWith(element);
506    *     }
507    *     String nextPageToken = response.getNextPageToken();
508    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
509    *       request = request.toBuilder().setPageToken(nextPageToken).build();
510    *     } else {
511    *       break;
512    *     }
513    *   }
514    * }
515    * }</pre>
516    */
517   public final UnaryCallable<
518           AggregatedListInstanceGroupManagersRequest, InstanceGroupManagerAggregatedList>
aggregatedListCallable()519       aggregatedListCallable() {
520     return stub.aggregatedListCallable();
521   }
522 
523   // AUTO-GENERATED DOCUMENTATION AND METHOD.
524   /**
525    * Applies changes to selected instances on the managed instance group. This method can be used to
526    * apply new overrides and/or new versions.
527    *
528    * <p>Sample code:
529    *
530    * <pre>{@code
531    * // This snippet has been automatically generated and should be regarded as a code template only.
532    * // It will require modifications to work:
533    * // - It may require correct/in-range values for request initialization.
534    * // - It may require specifying regional endpoints when creating the service client as shown in
535    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
536    * try (InstanceGroupManagersClient instanceGroupManagersClient =
537    *     InstanceGroupManagersClient.create()) {
538    *   String project = "project-309310695";
539    *   String zone = "zone3744684";
540    *   String instanceGroupManager = "instanceGroupManager-388242077";
541    *   InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource =
542    *       InstanceGroupManagersApplyUpdatesRequest.newBuilder().build();
543    *   Operation response =
544    *       instanceGroupManagersClient
545    *           .applyUpdatesToInstancesAsync(
546    *               project,
547    *               zone,
548    *               instanceGroupManager,
549    *               instanceGroupManagersApplyUpdatesRequestResource)
550    *           .get();
551    * }
552    * }</pre>
553    *
554    * @param project Project ID for this request.
555    * @param zone The name of the zone where the managed instance group is located. Should conform to
556    *     RFC1035.
557    * @param instanceGroupManager The name of the managed instance group, should conform to RFC1035.
558    * @param instanceGroupManagersApplyUpdatesRequestResource The body resource for this request
559    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
560    */
applyUpdatesToInstancesAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource)561   public final OperationFuture<Operation, Operation> applyUpdatesToInstancesAsync(
562       String project,
563       String zone,
564       String instanceGroupManager,
565       InstanceGroupManagersApplyUpdatesRequest instanceGroupManagersApplyUpdatesRequestResource) {
566     ApplyUpdatesToInstancesInstanceGroupManagerRequest request =
567         ApplyUpdatesToInstancesInstanceGroupManagerRequest.newBuilder()
568             .setProject(project)
569             .setZone(zone)
570             .setInstanceGroupManager(instanceGroupManager)
571             .setInstanceGroupManagersApplyUpdatesRequestResource(
572                 instanceGroupManagersApplyUpdatesRequestResource)
573             .build();
574     return applyUpdatesToInstancesAsync(request);
575   }
576 
577   // AUTO-GENERATED DOCUMENTATION AND METHOD.
578   /**
579    * Applies changes to selected instances on the managed instance group. This method can be used to
580    * apply new overrides and/or new versions.
581    *
582    * <p>Sample code:
583    *
584    * <pre>{@code
585    * // This snippet has been automatically generated and should be regarded as a code template only.
586    * // It will require modifications to work:
587    * // - It may require correct/in-range values for request initialization.
588    * // - It may require specifying regional endpoints when creating the service client as shown in
589    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
590    * try (InstanceGroupManagersClient instanceGroupManagersClient =
591    *     InstanceGroupManagersClient.create()) {
592    *   ApplyUpdatesToInstancesInstanceGroupManagerRequest request =
593    *       ApplyUpdatesToInstancesInstanceGroupManagerRequest.newBuilder()
594    *           .setInstanceGroupManager("instanceGroupManager-388242077")
595    *           .setInstanceGroupManagersApplyUpdatesRequestResource(
596    *               InstanceGroupManagersApplyUpdatesRequest.newBuilder().build())
597    *           .setProject("project-309310695")
598    *           .setZone("zone3744684")
599    *           .build();
600    *   Operation response = instanceGroupManagersClient.applyUpdatesToInstancesAsync(request).get();
601    * }
602    * }</pre>
603    *
604    * @param request The request object containing all of the parameters for the API call.
605    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
606    */
607   @BetaApi(
608       "The surface for long-running operations is not stable yet and may change in the future.")
applyUpdatesToInstancesAsync( ApplyUpdatesToInstancesInstanceGroupManagerRequest request)609   public final OperationFuture<Operation, Operation> applyUpdatesToInstancesAsync(
610       ApplyUpdatesToInstancesInstanceGroupManagerRequest request) {
611     return applyUpdatesToInstancesOperationCallable().futureCall(request);
612   }
613 
614   // AUTO-GENERATED DOCUMENTATION AND METHOD.
615   /**
616    * Applies changes to selected instances on the managed instance group. This method can be used to
617    * apply new overrides and/or new versions.
618    *
619    * <p>Sample code:
620    *
621    * <pre>{@code
622    * // This snippet has been automatically generated and should be regarded as a code template only.
623    * // It will require modifications to work:
624    * // - It may require correct/in-range values for request initialization.
625    * // - It may require specifying regional endpoints when creating the service client as shown in
626    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
627    * try (InstanceGroupManagersClient instanceGroupManagersClient =
628    *     InstanceGroupManagersClient.create()) {
629    *   ApplyUpdatesToInstancesInstanceGroupManagerRequest request =
630    *       ApplyUpdatesToInstancesInstanceGroupManagerRequest.newBuilder()
631    *           .setInstanceGroupManager("instanceGroupManager-388242077")
632    *           .setInstanceGroupManagersApplyUpdatesRequestResource(
633    *               InstanceGroupManagersApplyUpdatesRequest.newBuilder().build())
634    *           .setProject("project-309310695")
635    *           .setZone("zone3744684")
636    *           .build();
637    *   OperationFuture<Operation, Operation> future =
638    *       instanceGroupManagersClient
639    *           .applyUpdatesToInstancesOperationCallable()
640    *           .futureCall(request);
641    *   // Do something.
642    *   Operation response = future.get();
643    * }
644    * }</pre>
645    */
646   public final OperationCallable<
647           ApplyUpdatesToInstancesInstanceGroupManagerRequest, Operation, Operation>
applyUpdatesToInstancesOperationCallable()648       applyUpdatesToInstancesOperationCallable() {
649     return stub.applyUpdatesToInstancesOperationCallable();
650   }
651 
652   // AUTO-GENERATED DOCUMENTATION AND METHOD.
653   /**
654    * Applies changes to selected instances on the managed instance group. This method can be used to
655    * apply new overrides and/or new versions.
656    *
657    * <p>Sample code:
658    *
659    * <pre>{@code
660    * // This snippet has been automatically generated and should be regarded as a code template only.
661    * // It will require modifications to work:
662    * // - It may require correct/in-range values for request initialization.
663    * // - It may require specifying regional endpoints when creating the service client as shown in
664    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
665    * try (InstanceGroupManagersClient instanceGroupManagersClient =
666    *     InstanceGroupManagersClient.create()) {
667    *   ApplyUpdatesToInstancesInstanceGroupManagerRequest request =
668    *       ApplyUpdatesToInstancesInstanceGroupManagerRequest.newBuilder()
669    *           .setInstanceGroupManager("instanceGroupManager-388242077")
670    *           .setInstanceGroupManagersApplyUpdatesRequestResource(
671    *               InstanceGroupManagersApplyUpdatesRequest.newBuilder().build())
672    *           .setProject("project-309310695")
673    *           .setZone("zone3744684")
674    *           .build();
675    *   ApiFuture<Operation> future =
676    *       instanceGroupManagersClient.applyUpdatesToInstancesCallable().futureCall(request);
677    *   // Do something.
678    *   Operation response = future.get();
679    * }
680    * }</pre>
681    */
682   public final UnaryCallable<ApplyUpdatesToInstancesInstanceGroupManagerRequest, Operation>
applyUpdatesToInstancesCallable()683       applyUpdatesToInstancesCallable() {
684     return stub.applyUpdatesToInstancesCallable();
685   }
686 
687   // AUTO-GENERATED DOCUMENTATION AND METHOD.
688   /**
689    * Creates instances with per-instance configurations in this managed instance group. Instances
690    * are created using the current instance template. The create instances operation is marked DONE
691    * if the createInstances request is successful. The underlying actions take additional time. You
692    * must separately verify the status of the creating or actions with the listmanagedinstances
693    * method.
694    *
695    * <p>Sample code:
696    *
697    * <pre>{@code
698    * // This snippet has been automatically generated and should be regarded as a code template only.
699    * // It will require modifications to work:
700    * // - It may require correct/in-range values for request initialization.
701    * // - It may require specifying regional endpoints when creating the service client as shown in
702    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
703    * try (InstanceGroupManagersClient instanceGroupManagersClient =
704    *     InstanceGroupManagersClient.create()) {
705    *   String project = "project-309310695";
706    *   String zone = "zone3744684";
707    *   String instanceGroupManager = "instanceGroupManager-388242077";
708    *   InstanceGroupManagersCreateInstancesRequest
709    *       instanceGroupManagersCreateInstancesRequestResource =
710    *           InstanceGroupManagersCreateInstancesRequest.newBuilder().build();
711    *   Operation response =
712    *       instanceGroupManagersClient
713    *           .createInstancesAsync(
714    *               project,
715    *               zone,
716    *               instanceGroupManager,
717    *               instanceGroupManagersCreateInstancesRequestResource)
718    *           .get();
719    * }
720    * }</pre>
721    *
722    * @param project Project ID for this request.
723    * @param zone The name of the zone where the managed instance group is located. It should conform
724    *     to RFC1035.
725    * @param instanceGroupManager The name of the managed instance group. It should conform to
726    *     RFC1035.
727    * @param instanceGroupManagersCreateInstancesRequestResource The body resource for this request
728    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
729    */
createInstancesAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersCreateInstancesRequest instanceGroupManagersCreateInstancesRequestResource)730   public final OperationFuture<Operation, Operation> createInstancesAsync(
731       String project,
732       String zone,
733       String instanceGroupManager,
734       InstanceGroupManagersCreateInstancesRequest
735           instanceGroupManagersCreateInstancesRequestResource) {
736     CreateInstancesInstanceGroupManagerRequest request =
737         CreateInstancesInstanceGroupManagerRequest.newBuilder()
738             .setProject(project)
739             .setZone(zone)
740             .setInstanceGroupManager(instanceGroupManager)
741             .setInstanceGroupManagersCreateInstancesRequestResource(
742                 instanceGroupManagersCreateInstancesRequestResource)
743             .build();
744     return createInstancesAsync(request);
745   }
746 
747   // AUTO-GENERATED DOCUMENTATION AND METHOD.
748   /**
749    * Creates instances with per-instance configurations in this managed instance group. Instances
750    * are created using the current instance template. The create instances operation is marked DONE
751    * if the createInstances request is successful. The underlying actions take additional time. You
752    * must separately verify the status of the creating or actions with the listmanagedinstances
753    * method.
754    *
755    * <p>Sample code:
756    *
757    * <pre>{@code
758    * // This snippet has been automatically generated and should be regarded as a code template only.
759    * // It will require modifications to work:
760    * // - It may require correct/in-range values for request initialization.
761    * // - It may require specifying regional endpoints when creating the service client as shown in
762    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
763    * try (InstanceGroupManagersClient instanceGroupManagersClient =
764    *     InstanceGroupManagersClient.create()) {
765    *   CreateInstancesInstanceGroupManagerRequest request =
766    *       CreateInstancesInstanceGroupManagerRequest.newBuilder()
767    *           .setInstanceGroupManager("instanceGroupManager-388242077")
768    *           .setInstanceGroupManagersCreateInstancesRequestResource(
769    *               InstanceGroupManagersCreateInstancesRequest.newBuilder().build())
770    *           .setProject("project-309310695")
771    *           .setRequestId("requestId693933066")
772    *           .setZone("zone3744684")
773    *           .build();
774    *   Operation response = instanceGroupManagersClient.createInstancesAsync(request).get();
775    * }
776    * }</pre>
777    *
778    * @param request The request object containing all of the parameters for the API call.
779    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
780    */
781   @BetaApi(
782       "The surface for long-running operations is not stable yet and may change in the future.")
createInstancesAsync( CreateInstancesInstanceGroupManagerRequest request)783   public final OperationFuture<Operation, Operation> createInstancesAsync(
784       CreateInstancesInstanceGroupManagerRequest request) {
785     return createInstancesOperationCallable().futureCall(request);
786   }
787 
788   // AUTO-GENERATED DOCUMENTATION AND METHOD.
789   /**
790    * Creates instances with per-instance configurations in this managed instance group. Instances
791    * are created using the current instance template. The create instances operation is marked DONE
792    * if the createInstances request is successful. The underlying actions take additional time. You
793    * must separately verify the status of the creating or actions with the listmanagedinstances
794    * method.
795    *
796    * <p>Sample code:
797    *
798    * <pre>{@code
799    * // This snippet has been automatically generated and should be regarded as a code template only.
800    * // It will require modifications to work:
801    * // - It may require correct/in-range values for request initialization.
802    * // - It may require specifying regional endpoints when creating the service client as shown in
803    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
804    * try (InstanceGroupManagersClient instanceGroupManagersClient =
805    *     InstanceGroupManagersClient.create()) {
806    *   CreateInstancesInstanceGroupManagerRequest request =
807    *       CreateInstancesInstanceGroupManagerRequest.newBuilder()
808    *           .setInstanceGroupManager("instanceGroupManager-388242077")
809    *           .setInstanceGroupManagersCreateInstancesRequestResource(
810    *               InstanceGroupManagersCreateInstancesRequest.newBuilder().build())
811    *           .setProject("project-309310695")
812    *           .setRequestId("requestId693933066")
813    *           .setZone("zone3744684")
814    *           .build();
815    *   OperationFuture<Operation, Operation> future =
816    *       instanceGroupManagersClient.createInstancesOperationCallable().futureCall(request);
817    *   // Do something.
818    *   Operation response = future.get();
819    * }
820    * }</pre>
821    */
822   public final OperationCallable<CreateInstancesInstanceGroupManagerRequest, Operation, Operation>
createInstancesOperationCallable()823       createInstancesOperationCallable() {
824     return stub.createInstancesOperationCallable();
825   }
826 
827   // AUTO-GENERATED DOCUMENTATION AND METHOD.
828   /**
829    * Creates instances with per-instance configurations in this managed instance group. Instances
830    * are created using the current instance template. The create instances operation is marked DONE
831    * if the createInstances request is successful. The underlying actions take additional time. You
832    * must separately verify the status of the creating or actions with the listmanagedinstances
833    * method.
834    *
835    * <p>Sample code:
836    *
837    * <pre>{@code
838    * // This snippet has been automatically generated and should be regarded as a code template only.
839    * // It will require modifications to work:
840    * // - It may require correct/in-range values for request initialization.
841    * // - It may require specifying regional endpoints when creating the service client as shown in
842    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
843    * try (InstanceGroupManagersClient instanceGroupManagersClient =
844    *     InstanceGroupManagersClient.create()) {
845    *   CreateInstancesInstanceGroupManagerRequest request =
846    *       CreateInstancesInstanceGroupManagerRequest.newBuilder()
847    *           .setInstanceGroupManager("instanceGroupManager-388242077")
848    *           .setInstanceGroupManagersCreateInstancesRequestResource(
849    *               InstanceGroupManagersCreateInstancesRequest.newBuilder().build())
850    *           .setProject("project-309310695")
851    *           .setRequestId("requestId693933066")
852    *           .setZone("zone3744684")
853    *           .build();
854    *   ApiFuture<Operation> future =
855    *       instanceGroupManagersClient.createInstancesCallable().futureCall(request);
856    *   // Do something.
857    *   Operation response = future.get();
858    * }
859    * }</pre>
860    */
861   public final UnaryCallable<CreateInstancesInstanceGroupManagerRequest, Operation>
createInstancesCallable()862       createInstancesCallable() {
863     return stub.createInstancesCallable();
864   }
865 
866   // AUTO-GENERATED DOCUMENTATION AND METHOD.
867   /**
868    * Deletes the specified managed instance group and all of the instances in that group. Note that
869    * the instance group must not belong to a backend service. Read Deleting an instance group for
870    * more information.
871    *
872    * <p>Sample code:
873    *
874    * <pre>{@code
875    * // This snippet has been automatically generated and should be regarded as a code template only.
876    * // It will require modifications to work:
877    * // - It may require correct/in-range values for request initialization.
878    * // - It may require specifying regional endpoints when creating the service client as shown in
879    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
880    * try (InstanceGroupManagersClient instanceGroupManagersClient =
881    *     InstanceGroupManagersClient.create()) {
882    *   String project = "project-309310695";
883    *   String zone = "zone3744684";
884    *   String instanceGroupManager = "instanceGroupManager-388242077";
885    *   Operation response =
886    *       instanceGroupManagersClient.deleteAsync(project, zone, instanceGroupManager).get();
887    * }
888    * }</pre>
889    *
890    * @param project Project ID for this request.
891    * @param zone The name of the zone where the managed instance group is located.
892    * @param instanceGroupManager The name of the managed instance group to delete.
893    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
894    */
deleteAsync( String project, String zone, String instanceGroupManager)895   public final OperationFuture<Operation, Operation> deleteAsync(
896       String project, String zone, String instanceGroupManager) {
897     DeleteInstanceGroupManagerRequest request =
898         DeleteInstanceGroupManagerRequest.newBuilder()
899             .setProject(project)
900             .setZone(zone)
901             .setInstanceGroupManager(instanceGroupManager)
902             .build();
903     return deleteAsync(request);
904   }
905 
906   // AUTO-GENERATED DOCUMENTATION AND METHOD.
907   /**
908    * Deletes the specified managed instance group and all of the instances in that group. Note that
909    * the instance group must not belong to a backend service. Read Deleting an instance group for
910    * more information.
911    *
912    * <p>Sample code:
913    *
914    * <pre>{@code
915    * // This snippet has been automatically generated and should be regarded as a code template only.
916    * // It will require modifications to work:
917    * // - It may require correct/in-range values for request initialization.
918    * // - It may require specifying regional endpoints when creating the service client as shown in
919    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
920    * try (InstanceGroupManagersClient instanceGroupManagersClient =
921    *     InstanceGroupManagersClient.create()) {
922    *   DeleteInstanceGroupManagerRequest request =
923    *       DeleteInstanceGroupManagerRequest.newBuilder()
924    *           .setInstanceGroupManager("instanceGroupManager-388242077")
925    *           .setProject("project-309310695")
926    *           .setRequestId("requestId693933066")
927    *           .setZone("zone3744684")
928    *           .build();
929    *   Operation response = instanceGroupManagersClient.deleteAsync(request).get();
930    * }
931    * }</pre>
932    *
933    * @param request The request object containing all of the parameters for the API call.
934    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
935    */
936   @BetaApi(
937       "The surface for long-running operations is not stable yet and may change in the future.")
deleteAsync( DeleteInstanceGroupManagerRequest request)938   public final OperationFuture<Operation, Operation> deleteAsync(
939       DeleteInstanceGroupManagerRequest request) {
940     return deleteOperationCallable().futureCall(request);
941   }
942 
943   // AUTO-GENERATED DOCUMENTATION AND METHOD.
944   /**
945    * Deletes the specified managed instance group and all of the instances in that group. Note that
946    * the instance group must not belong to a backend service. Read Deleting an instance group for
947    * more information.
948    *
949    * <p>Sample code:
950    *
951    * <pre>{@code
952    * // This snippet has been automatically generated and should be regarded as a code template only.
953    * // It will require modifications to work:
954    * // - It may require correct/in-range values for request initialization.
955    * // - It may require specifying regional endpoints when creating the service client as shown in
956    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
957    * try (InstanceGroupManagersClient instanceGroupManagersClient =
958    *     InstanceGroupManagersClient.create()) {
959    *   DeleteInstanceGroupManagerRequest request =
960    *       DeleteInstanceGroupManagerRequest.newBuilder()
961    *           .setInstanceGroupManager("instanceGroupManager-388242077")
962    *           .setProject("project-309310695")
963    *           .setRequestId("requestId693933066")
964    *           .setZone("zone3744684")
965    *           .build();
966    *   OperationFuture<Operation, Operation> future =
967    *       instanceGroupManagersClient.deleteOperationCallable().futureCall(request);
968    *   // Do something.
969    *   Operation response = future.get();
970    * }
971    * }</pre>
972    */
973   public final OperationCallable<DeleteInstanceGroupManagerRequest, Operation, Operation>
deleteOperationCallable()974       deleteOperationCallable() {
975     return stub.deleteOperationCallable();
976   }
977 
978   // AUTO-GENERATED DOCUMENTATION AND METHOD.
979   /**
980    * Deletes the specified managed instance group and all of the instances in that group. Note that
981    * the instance group must not belong to a backend service. Read Deleting an instance group for
982    * more information.
983    *
984    * <p>Sample code:
985    *
986    * <pre>{@code
987    * // This snippet has been automatically generated and should be regarded as a code template only.
988    * // It will require modifications to work:
989    * // - It may require correct/in-range values for request initialization.
990    * // - It may require specifying regional endpoints when creating the service client as shown in
991    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
992    * try (InstanceGroupManagersClient instanceGroupManagersClient =
993    *     InstanceGroupManagersClient.create()) {
994    *   DeleteInstanceGroupManagerRequest request =
995    *       DeleteInstanceGroupManagerRequest.newBuilder()
996    *           .setInstanceGroupManager("instanceGroupManager-388242077")
997    *           .setProject("project-309310695")
998    *           .setRequestId("requestId693933066")
999    *           .setZone("zone3744684")
1000    *           .build();
1001    *   ApiFuture<Operation> future =
1002    *       instanceGroupManagersClient.deleteCallable().futureCall(request);
1003    *   // Do something.
1004    *   Operation response = future.get();
1005    * }
1006    * }</pre>
1007    */
deleteCallable()1008   public final UnaryCallable<DeleteInstanceGroupManagerRequest, Operation> deleteCallable() {
1009     return stub.deleteCallable();
1010   }
1011 
1012   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1013   /**
1014    * Flags the specified instances in the managed instance group for immediate deletion. The
1015    * instances are also removed from any target pools of which they were a member. This method
1016    * reduces the targetSize of the managed instance group by the number of instances that you
1017    * delete. This operation is marked as DONE when the action is scheduled even if the instances are
1018    * still being deleted. You must separately verify the status of the deleting action with the
1019    * listmanagedinstances method. If the group is part of a backend service that has enabled
1020    * connection draining, it can take up to 60 seconds after the connection draining duration has
1021    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
1022    * instances with this method per request.
1023    *
1024    * <p>Sample code:
1025    *
1026    * <pre>{@code
1027    * // This snippet has been automatically generated and should be regarded as a code template only.
1028    * // It will require modifications to work:
1029    * // - It may require correct/in-range values for request initialization.
1030    * // - It may require specifying regional endpoints when creating the service client as shown in
1031    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1032    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1033    *     InstanceGroupManagersClient.create()) {
1034    *   String project = "project-309310695";
1035    *   String zone = "zone3744684";
1036    *   String instanceGroupManager = "instanceGroupManager-388242077";
1037    *   InstanceGroupManagersDeleteInstancesRequest
1038    *       instanceGroupManagersDeleteInstancesRequestResource =
1039    *           InstanceGroupManagersDeleteInstancesRequest.newBuilder().build();
1040    *   Operation response =
1041    *       instanceGroupManagersClient
1042    *           .deleteInstancesAsync(
1043    *               project,
1044    *               zone,
1045    *               instanceGroupManager,
1046    *               instanceGroupManagersDeleteInstancesRequestResource)
1047    *           .get();
1048    * }
1049    * }</pre>
1050    *
1051    * @param project Project ID for this request.
1052    * @param zone The name of the zone where the managed instance group is located.
1053    * @param instanceGroupManager The name of the managed instance group.
1054    * @param instanceGroupManagersDeleteInstancesRequestResource The body resource for this request
1055    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1056    */
deleteInstancesAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersDeleteInstancesRequest instanceGroupManagersDeleteInstancesRequestResource)1057   public final OperationFuture<Operation, Operation> deleteInstancesAsync(
1058       String project,
1059       String zone,
1060       String instanceGroupManager,
1061       InstanceGroupManagersDeleteInstancesRequest
1062           instanceGroupManagersDeleteInstancesRequestResource) {
1063     DeleteInstancesInstanceGroupManagerRequest request =
1064         DeleteInstancesInstanceGroupManagerRequest.newBuilder()
1065             .setProject(project)
1066             .setZone(zone)
1067             .setInstanceGroupManager(instanceGroupManager)
1068             .setInstanceGroupManagersDeleteInstancesRequestResource(
1069                 instanceGroupManagersDeleteInstancesRequestResource)
1070             .build();
1071     return deleteInstancesAsync(request);
1072   }
1073 
1074   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1075   /**
1076    * Flags the specified instances in the managed instance group for immediate deletion. The
1077    * instances are also removed from any target pools of which they were a member. This method
1078    * reduces the targetSize of the managed instance group by the number of instances that you
1079    * delete. This operation is marked as DONE when the action is scheduled even if the instances are
1080    * still being deleted. You must separately verify the status of the deleting action with the
1081    * listmanagedinstances method. If the group is part of a backend service that has enabled
1082    * connection draining, it can take up to 60 seconds after the connection draining duration has
1083    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
1084    * instances with this method per request.
1085    *
1086    * <p>Sample code:
1087    *
1088    * <pre>{@code
1089    * // This snippet has been automatically generated and should be regarded as a code template only.
1090    * // It will require modifications to work:
1091    * // - It may require correct/in-range values for request initialization.
1092    * // - It may require specifying regional endpoints when creating the service client as shown in
1093    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1094    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1095    *     InstanceGroupManagersClient.create()) {
1096    *   DeleteInstancesInstanceGroupManagerRequest request =
1097    *       DeleteInstancesInstanceGroupManagerRequest.newBuilder()
1098    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1099    *           .setInstanceGroupManagersDeleteInstancesRequestResource(
1100    *               InstanceGroupManagersDeleteInstancesRequest.newBuilder().build())
1101    *           .setProject("project-309310695")
1102    *           .setRequestId("requestId693933066")
1103    *           .setZone("zone3744684")
1104    *           .build();
1105    *   Operation response = instanceGroupManagersClient.deleteInstancesAsync(request).get();
1106    * }
1107    * }</pre>
1108    *
1109    * @param request The request object containing all of the parameters for the API call.
1110    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1111    */
1112   @BetaApi(
1113       "The surface for long-running operations is not stable yet and may change in the future.")
deleteInstancesAsync( DeleteInstancesInstanceGroupManagerRequest request)1114   public final OperationFuture<Operation, Operation> deleteInstancesAsync(
1115       DeleteInstancesInstanceGroupManagerRequest request) {
1116     return deleteInstancesOperationCallable().futureCall(request);
1117   }
1118 
1119   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1120   /**
1121    * Flags the specified instances in the managed instance group for immediate deletion. The
1122    * instances are also removed from any target pools of which they were a member. This method
1123    * reduces the targetSize of the managed instance group by the number of instances that you
1124    * delete. This operation is marked as DONE when the action is scheduled even if the instances are
1125    * still being deleted. You must separately verify the status of the deleting action with the
1126    * listmanagedinstances method. If the group is part of a backend service that has enabled
1127    * connection draining, it can take up to 60 seconds after the connection draining duration has
1128    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
1129    * instances with this method per request.
1130    *
1131    * <p>Sample code:
1132    *
1133    * <pre>{@code
1134    * // This snippet has been automatically generated and should be regarded as a code template only.
1135    * // It will require modifications to work:
1136    * // - It may require correct/in-range values for request initialization.
1137    * // - It may require specifying regional endpoints when creating the service client as shown in
1138    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1139    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1140    *     InstanceGroupManagersClient.create()) {
1141    *   DeleteInstancesInstanceGroupManagerRequest request =
1142    *       DeleteInstancesInstanceGroupManagerRequest.newBuilder()
1143    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1144    *           .setInstanceGroupManagersDeleteInstancesRequestResource(
1145    *               InstanceGroupManagersDeleteInstancesRequest.newBuilder().build())
1146    *           .setProject("project-309310695")
1147    *           .setRequestId("requestId693933066")
1148    *           .setZone("zone3744684")
1149    *           .build();
1150    *   OperationFuture<Operation, Operation> future =
1151    *       instanceGroupManagersClient.deleteInstancesOperationCallable().futureCall(request);
1152    *   // Do something.
1153    *   Operation response = future.get();
1154    * }
1155    * }</pre>
1156    */
1157   public final OperationCallable<DeleteInstancesInstanceGroupManagerRequest, Operation, Operation>
deleteInstancesOperationCallable()1158       deleteInstancesOperationCallable() {
1159     return stub.deleteInstancesOperationCallable();
1160   }
1161 
1162   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1163   /**
1164    * Flags the specified instances in the managed instance group for immediate deletion. The
1165    * instances are also removed from any target pools of which they were a member. This method
1166    * reduces the targetSize of the managed instance group by the number of instances that you
1167    * delete. This operation is marked as DONE when the action is scheduled even if the instances are
1168    * still being deleted. You must separately verify the status of the deleting action with the
1169    * listmanagedinstances method. If the group is part of a backend service that has enabled
1170    * connection draining, it can take up to 60 seconds after the connection draining duration has
1171    * elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000
1172    * instances with this method per request.
1173    *
1174    * <p>Sample code:
1175    *
1176    * <pre>{@code
1177    * // This snippet has been automatically generated and should be regarded as a code template only.
1178    * // It will require modifications to work:
1179    * // - It may require correct/in-range values for request initialization.
1180    * // - It may require specifying regional endpoints when creating the service client as shown in
1181    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1182    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1183    *     InstanceGroupManagersClient.create()) {
1184    *   DeleteInstancesInstanceGroupManagerRequest request =
1185    *       DeleteInstancesInstanceGroupManagerRequest.newBuilder()
1186    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1187    *           .setInstanceGroupManagersDeleteInstancesRequestResource(
1188    *               InstanceGroupManagersDeleteInstancesRequest.newBuilder().build())
1189    *           .setProject("project-309310695")
1190    *           .setRequestId("requestId693933066")
1191    *           .setZone("zone3744684")
1192    *           .build();
1193    *   ApiFuture<Operation> future =
1194    *       instanceGroupManagersClient.deleteInstancesCallable().futureCall(request);
1195    *   // Do something.
1196    *   Operation response = future.get();
1197    * }
1198    * }</pre>
1199    */
1200   public final UnaryCallable<DeleteInstancesInstanceGroupManagerRequest, Operation>
deleteInstancesCallable()1201       deleteInstancesCallable() {
1202     return stub.deleteInstancesCallable();
1203   }
1204 
1205   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1206   /**
1207    * Deletes selected per-instance configurations for the managed instance group.
1208    *
1209    * <p>Sample code:
1210    *
1211    * <pre>{@code
1212    * // This snippet has been automatically generated and should be regarded as a code template only.
1213    * // It will require modifications to work:
1214    * // - It may require correct/in-range values for request initialization.
1215    * // - It may require specifying regional endpoints when creating the service client as shown in
1216    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1217    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1218    *     InstanceGroupManagersClient.create()) {
1219    *   String project = "project-309310695";
1220    *   String zone = "zone3744684";
1221    *   String instanceGroupManager = "instanceGroupManager-388242077";
1222    *   InstanceGroupManagersDeletePerInstanceConfigsReq
1223    *       instanceGroupManagersDeletePerInstanceConfigsReqResource =
1224    *           InstanceGroupManagersDeletePerInstanceConfigsReq.newBuilder().build();
1225    *   Operation response =
1226    *       instanceGroupManagersClient
1227    *           .deletePerInstanceConfigsAsync(
1228    *               project,
1229    *               zone,
1230    *               instanceGroupManager,
1231    *               instanceGroupManagersDeletePerInstanceConfigsReqResource)
1232    *           .get();
1233    * }
1234    * }</pre>
1235    *
1236    * @param project Project ID for this request.
1237    * @param zone The name of the zone where the managed instance group is located. It should conform
1238    *     to RFC1035.
1239    * @param instanceGroupManager The name of the managed instance group. It should conform to
1240    *     RFC1035.
1241    * @param instanceGroupManagersDeletePerInstanceConfigsReqResource The body resource for this
1242    *     request
1243    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1244    */
deletePerInstanceConfigsAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersDeletePerInstanceConfigsReq instanceGroupManagersDeletePerInstanceConfigsReqResource)1245   public final OperationFuture<Operation, Operation> deletePerInstanceConfigsAsync(
1246       String project,
1247       String zone,
1248       String instanceGroupManager,
1249       InstanceGroupManagersDeletePerInstanceConfigsReq
1250           instanceGroupManagersDeletePerInstanceConfigsReqResource) {
1251     DeletePerInstanceConfigsInstanceGroupManagerRequest request =
1252         DeletePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
1253             .setProject(project)
1254             .setZone(zone)
1255             .setInstanceGroupManager(instanceGroupManager)
1256             .setInstanceGroupManagersDeletePerInstanceConfigsReqResource(
1257                 instanceGroupManagersDeletePerInstanceConfigsReqResource)
1258             .build();
1259     return deletePerInstanceConfigsAsync(request);
1260   }
1261 
1262   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1263   /**
1264    * Deletes selected per-instance configurations for the managed instance group.
1265    *
1266    * <p>Sample code:
1267    *
1268    * <pre>{@code
1269    * // This snippet has been automatically generated and should be regarded as a code template only.
1270    * // It will require modifications to work:
1271    * // - It may require correct/in-range values for request initialization.
1272    * // - It may require specifying regional endpoints when creating the service client as shown in
1273    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1274    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1275    *     InstanceGroupManagersClient.create()) {
1276    *   DeletePerInstanceConfigsInstanceGroupManagerRequest request =
1277    *       DeletePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
1278    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1279    *           .setInstanceGroupManagersDeletePerInstanceConfigsReqResource(
1280    *               InstanceGroupManagersDeletePerInstanceConfigsReq.newBuilder().build())
1281    *           .setProject("project-309310695")
1282    *           .setZone("zone3744684")
1283    *           .build();
1284    *   Operation response = instanceGroupManagersClient.deletePerInstanceConfigsAsync(request).get();
1285    * }
1286    * }</pre>
1287    *
1288    * @param request The request object containing all of the parameters for the API call.
1289    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1290    */
1291   @BetaApi(
1292       "The surface for long-running operations is not stable yet and may change in the future.")
deletePerInstanceConfigsAsync( DeletePerInstanceConfigsInstanceGroupManagerRequest request)1293   public final OperationFuture<Operation, Operation> deletePerInstanceConfigsAsync(
1294       DeletePerInstanceConfigsInstanceGroupManagerRequest request) {
1295     return deletePerInstanceConfigsOperationCallable().futureCall(request);
1296   }
1297 
1298   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1299   /**
1300    * Deletes selected per-instance configurations for the managed instance group.
1301    *
1302    * <p>Sample code:
1303    *
1304    * <pre>{@code
1305    * // This snippet has been automatically generated and should be regarded as a code template only.
1306    * // It will require modifications to work:
1307    * // - It may require correct/in-range values for request initialization.
1308    * // - It may require specifying regional endpoints when creating the service client as shown in
1309    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1310    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1311    *     InstanceGroupManagersClient.create()) {
1312    *   DeletePerInstanceConfigsInstanceGroupManagerRequest request =
1313    *       DeletePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
1314    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1315    *           .setInstanceGroupManagersDeletePerInstanceConfigsReqResource(
1316    *               InstanceGroupManagersDeletePerInstanceConfigsReq.newBuilder().build())
1317    *           .setProject("project-309310695")
1318    *           .setZone("zone3744684")
1319    *           .build();
1320    *   OperationFuture<Operation, Operation> future =
1321    *       instanceGroupManagersClient
1322    *           .deletePerInstanceConfigsOperationCallable()
1323    *           .futureCall(request);
1324    *   // Do something.
1325    *   Operation response = future.get();
1326    * }
1327    * }</pre>
1328    */
1329   public final OperationCallable<
1330           DeletePerInstanceConfigsInstanceGroupManagerRequest, Operation, Operation>
deletePerInstanceConfigsOperationCallable()1331       deletePerInstanceConfigsOperationCallable() {
1332     return stub.deletePerInstanceConfigsOperationCallable();
1333   }
1334 
1335   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1336   /**
1337    * Deletes selected per-instance configurations for the managed instance group.
1338    *
1339    * <p>Sample code:
1340    *
1341    * <pre>{@code
1342    * // This snippet has been automatically generated and should be regarded as a code template only.
1343    * // It will require modifications to work:
1344    * // - It may require correct/in-range values for request initialization.
1345    * // - It may require specifying regional endpoints when creating the service client as shown in
1346    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1347    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1348    *     InstanceGroupManagersClient.create()) {
1349    *   DeletePerInstanceConfigsInstanceGroupManagerRequest request =
1350    *       DeletePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
1351    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1352    *           .setInstanceGroupManagersDeletePerInstanceConfigsReqResource(
1353    *               InstanceGroupManagersDeletePerInstanceConfigsReq.newBuilder().build())
1354    *           .setProject("project-309310695")
1355    *           .setZone("zone3744684")
1356    *           .build();
1357    *   ApiFuture<Operation> future =
1358    *       instanceGroupManagersClient.deletePerInstanceConfigsCallable().futureCall(request);
1359    *   // Do something.
1360    *   Operation response = future.get();
1361    * }
1362    * }</pre>
1363    */
1364   public final UnaryCallable<DeletePerInstanceConfigsInstanceGroupManagerRequest, Operation>
deletePerInstanceConfigsCallable()1365       deletePerInstanceConfigsCallable() {
1366     return stub.deletePerInstanceConfigsCallable();
1367   }
1368 
1369   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1370   /**
1371    * Returns all of the details about the specified managed instance group.
1372    *
1373    * <p>Sample code:
1374    *
1375    * <pre>{@code
1376    * // This snippet has been automatically generated and should be regarded as a code template only.
1377    * // It will require modifications to work:
1378    * // - It may require correct/in-range values for request initialization.
1379    * // - It may require specifying regional endpoints when creating the service client as shown in
1380    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1381    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1382    *     InstanceGroupManagersClient.create()) {
1383    *   String project = "project-309310695";
1384    *   String zone = "zone3744684";
1385    *   String instanceGroupManager = "instanceGroupManager-388242077";
1386    *   InstanceGroupManager response =
1387    *       instanceGroupManagersClient.get(project, zone, instanceGroupManager);
1388    * }
1389    * }</pre>
1390    *
1391    * @param project Project ID for this request.
1392    * @param zone The name of the zone where the managed instance group is located.
1393    * @param instanceGroupManager The name of the managed instance group.
1394    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1395    */
get(String project, String zone, String instanceGroupManager)1396   public final InstanceGroupManager get(String project, String zone, String instanceGroupManager) {
1397     GetInstanceGroupManagerRequest request =
1398         GetInstanceGroupManagerRequest.newBuilder()
1399             .setProject(project)
1400             .setZone(zone)
1401             .setInstanceGroupManager(instanceGroupManager)
1402             .build();
1403     return get(request);
1404   }
1405 
1406   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1407   /**
1408    * Returns all of the details about the specified managed instance group.
1409    *
1410    * <p>Sample code:
1411    *
1412    * <pre>{@code
1413    * // This snippet has been automatically generated and should be regarded as a code template only.
1414    * // It will require modifications to work:
1415    * // - It may require correct/in-range values for request initialization.
1416    * // - It may require specifying regional endpoints when creating the service client as shown in
1417    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1418    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1419    *     InstanceGroupManagersClient.create()) {
1420    *   GetInstanceGroupManagerRequest request =
1421    *       GetInstanceGroupManagerRequest.newBuilder()
1422    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1423    *           .setProject("project-309310695")
1424    *           .setZone("zone3744684")
1425    *           .build();
1426    *   InstanceGroupManager response = instanceGroupManagersClient.get(request);
1427    * }
1428    * }</pre>
1429    *
1430    * @param request The request object containing all of the parameters for the API call.
1431    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1432    */
get(GetInstanceGroupManagerRequest request)1433   public final InstanceGroupManager get(GetInstanceGroupManagerRequest request) {
1434     return getCallable().call(request);
1435   }
1436 
1437   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1438   /**
1439    * Returns all of the details about the specified managed instance group.
1440    *
1441    * <p>Sample code:
1442    *
1443    * <pre>{@code
1444    * // This snippet has been automatically generated and should be regarded as a code template only.
1445    * // It will require modifications to work:
1446    * // - It may require correct/in-range values for request initialization.
1447    * // - It may require specifying regional endpoints when creating the service client as shown in
1448    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1449    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1450    *     InstanceGroupManagersClient.create()) {
1451    *   GetInstanceGroupManagerRequest request =
1452    *       GetInstanceGroupManagerRequest.newBuilder()
1453    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1454    *           .setProject("project-309310695")
1455    *           .setZone("zone3744684")
1456    *           .build();
1457    *   ApiFuture<InstanceGroupManager> future =
1458    *       instanceGroupManagersClient.getCallable().futureCall(request);
1459    *   // Do something.
1460    *   InstanceGroupManager response = future.get();
1461    * }
1462    * }</pre>
1463    */
getCallable()1464   public final UnaryCallable<GetInstanceGroupManagerRequest, InstanceGroupManager> getCallable() {
1465     return stub.getCallable();
1466   }
1467 
1468   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1469   /**
1470    * Creates a managed instance group using the information that you specify in the request. After
1471    * the group is created, instances in the group are created using the specified instance template.
1472    * This operation is marked as DONE when the group is created even if the instances in the group
1473    * have not yet been created. You must separately verify the status of the individual instances
1474    * with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances
1475    * per group. Please contact Cloud Support if you need an increase in this limit.
1476    *
1477    * <p>Sample code:
1478    *
1479    * <pre>{@code
1480    * // This snippet has been automatically generated and should be regarded as a code template only.
1481    * // It will require modifications to work:
1482    * // - It may require correct/in-range values for request initialization.
1483    * // - It may require specifying regional endpoints when creating the service client as shown in
1484    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1485    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1486    *     InstanceGroupManagersClient.create()) {
1487    *   String project = "project-309310695";
1488    *   String zone = "zone3744684";
1489    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
1490    *   Operation response =
1491    *       instanceGroupManagersClient
1492    *           .insertAsync(project, zone, instanceGroupManagerResource)
1493    *           .get();
1494    * }
1495    * }</pre>
1496    *
1497    * @param project Project ID for this request.
1498    * @param zone The name of the zone where you want to create the managed instance group.
1499    * @param instanceGroupManagerResource The body resource for this request
1500    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1501    */
insertAsync( String project, String zone, InstanceGroupManager instanceGroupManagerResource)1502   public final OperationFuture<Operation, Operation> insertAsync(
1503       String project, String zone, InstanceGroupManager instanceGroupManagerResource) {
1504     InsertInstanceGroupManagerRequest request =
1505         InsertInstanceGroupManagerRequest.newBuilder()
1506             .setProject(project)
1507             .setZone(zone)
1508             .setInstanceGroupManagerResource(instanceGroupManagerResource)
1509             .build();
1510     return insertAsync(request);
1511   }
1512 
1513   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1514   /**
1515    * Creates a managed instance group using the information that you specify in the request. After
1516    * the group is created, instances in the group are created using the specified instance template.
1517    * This operation is marked as DONE when the group is created even if the instances in the group
1518    * have not yet been created. You must separately verify the status of the individual instances
1519    * with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances
1520    * per group. Please contact Cloud Support if you need an increase in this limit.
1521    *
1522    * <p>Sample code:
1523    *
1524    * <pre>{@code
1525    * // This snippet has been automatically generated and should be regarded as a code template only.
1526    * // It will require modifications to work:
1527    * // - It may require correct/in-range values for request initialization.
1528    * // - It may require specifying regional endpoints when creating the service client as shown in
1529    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1530    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1531    *     InstanceGroupManagersClient.create()) {
1532    *   InsertInstanceGroupManagerRequest request =
1533    *       InsertInstanceGroupManagerRequest.newBuilder()
1534    *           .setInstanceGroupManagerResource(InstanceGroupManager.newBuilder().build())
1535    *           .setProject("project-309310695")
1536    *           .setRequestId("requestId693933066")
1537    *           .setZone("zone3744684")
1538    *           .build();
1539    *   Operation response = instanceGroupManagersClient.insertAsync(request).get();
1540    * }
1541    * }</pre>
1542    *
1543    * @param request The request object containing all of the parameters for the API call.
1544    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1545    */
1546   @BetaApi(
1547       "The surface for long-running operations is not stable yet and may change in the future.")
insertAsync( InsertInstanceGroupManagerRequest request)1548   public final OperationFuture<Operation, Operation> insertAsync(
1549       InsertInstanceGroupManagerRequest request) {
1550     return insertOperationCallable().futureCall(request);
1551   }
1552 
1553   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1554   /**
1555    * Creates a managed instance group using the information that you specify in the request. After
1556    * the group is created, instances in the group are created using the specified instance template.
1557    * This operation is marked as DONE when the group is created even if the instances in the group
1558    * have not yet been created. You must separately verify the status of the individual instances
1559    * with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances
1560    * per group. Please contact Cloud Support if you need an increase in this limit.
1561    *
1562    * <p>Sample code:
1563    *
1564    * <pre>{@code
1565    * // This snippet has been automatically generated and should be regarded as a code template only.
1566    * // It will require modifications to work:
1567    * // - It may require correct/in-range values for request initialization.
1568    * // - It may require specifying regional endpoints when creating the service client as shown in
1569    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1570    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1571    *     InstanceGroupManagersClient.create()) {
1572    *   InsertInstanceGroupManagerRequest request =
1573    *       InsertInstanceGroupManagerRequest.newBuilder()
1574    *           .setInstanceGroupManagerResource(InstanceGroupManager.newBuilder().build())
1575    *           .setProject("project-309310695")
1576    *           .setRequestId("requestId693933066")
1577    *           .setZone("zone3744684")
1578    *           .build();
1579    *   OperationFuture<Operation, Operation> future =
1580    *       instanceGroupManagersClient.insertOperationCallable().futureCall(request);
1581    *   // Do something.
1582    *   Operation response = future.get();
1583    * }
1584    * }</pre>
1585    */
1586   public final OperationCallable<InsertInstanceGroupManagerRequest, Operation, Operation>
insertOperationCallable()1587       insertOperationCallable() {
1588     return stub.insertOperationCallable();
1589   }
1590 
1591   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1592   /**
1593    * Creates a managed instance group using the information that you specify in the request. After
1594    * the group is created, instances in the group are created using the specified instance template.
1595    * This operation is marked as DONE when the group is created even if the instances in the group
1596    * have not yet been created. You must separately verify the status of the individual instances
1597    * with the listmanagedinstances method. A managed instance group can have up to 1000 VM instances
1598    * per group. Please contact Cloud Support if you need an increase in this limit.
1599    *
1600    * <p>Sample code:
1601    *
1602    * <pre>{@code
1603    * // This snippet has been automatically generated and should be regarded as a code template only.
1604    * // It will require modifications to work:
1605    * // - It may require correct/in-range values for request initialization.
1606    * // - It may require specifying regional endpoints when creating the service client as shown in
1607    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1608    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1609    *     InstanceGroupManagersClient.create()) {
1610    *   InsertInstanceGroupManagerRequest request =
1611    *       InsertInstanceGroupManagerRequest.newBuilder()
1612    *           .setInstanceGroupManagerResource(InstanceGroupManager.newBuilder().build())
1613    *           .setProject("project-309310695")
1614    *           .setRequestId("requestId693933066")
1615    *           .setZone("zone3744684")
1616    *           .build();
1617    *   ApiFuture<Operation> future =
1618    *       instanceGroupManagersClient.insertCallable().futureCall(request);
1619    *   // Do something.
1620    *   Operation response = future.get();
1621    * }
1622    * }</pre>
1623    */
insertCallable()1624   public final UnaryCallable<InsertInstanceGroupManagerRequest, Operation> insertCallable() {
1625     return stub.insertCallable();
1626   }
1627 
1628   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1629   /**
1630    * Retrieves a list of managed instance groups that are contained within the specified project and
1631    * zone.
1632    *
1633    * <p>Sample code:
1634    *
1635    * <pre>{@code
1636    * // This snippet has been automatically generated and should be regarded as a code template only.
1637    * // It will require modifications to work:
1638    * // - It may require correct/in-range values for request initialization.
1639    * // - It may require specifying regional endpoints when creating the service client as shown in
1640    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1641    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1642    *     InstanceGroupManagersClient.create()) {
1643    *   String project = "project-309310695";
1644    *   String zone = "zone3744684";
1645    *   for (InstanceGroupManager element :
1646    *       instanceGroupManagersClient.list(project, zone).iterateAll()) {
1647    *     // doThingsWith(element);
1648    *   }
1649    * }
1650    * }</pre>
1651    *
1652    * @param project Project ID for this request.
1653    * @param zone The name of the zone where the managed instance group is located.
1654    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1655    */
list(String project, String zone)1656   public final ListPagedResponse list(String project, String zone) {
1657     ListInstanceGroupManagersRequest request =
1658         ListInstanceGroupManagersRequest.newBuilder().setProject(project).setZone(zone).build();
1659     return list(request);
1660   }
1661 
1662   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1663   /**
1664    * Retrieves a list of managed instance groups that are contained within the specified project and
1665    * zone.
1666    *
1667    * <p>Sample code:
1668    *
1669    * <pre>{@code
1670    * // This snippet has been automatically generated and should be regarded as a code template only.
1671    * // It will require modifications to work:
1672    * // - It may require correct/in-range values for request initialization.
1673    * // - It may require specifying regional endpoints when creating the service client as shown in
1674    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1675    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1676    *     InstanceGroupManagersClient.create()) {
1677    *   ListInstanceGroupManagersRequest request =
1678    *       ListInstanceGroupManagersRequest.newBuilder()
1679    *           .setFilter("filter-1274492040")
1680    *           .setMaxResults(1128457243)
1681    *           .setOrderBy("orderBy-1207110587")
1682    *           .setPageToken("pageToken873572522")
1683    *           .setProject("project-309310695")
1684    *           .setReturnPartialSuccess(true)
1685    *           .setZone("zone3744684")
1686    *           .build();
1687    *   for (InstanceGroupManager element : instanceGroupManagersClient.list(request).iterateAll()) {
1688    *     // doThingsWith(element);
1689    *   }
1690    * }
1691    * }</pre>
1692    *
1693    * @param request The request object containing all of the parameters for the API call.
1694    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1695    */
list(ListInstanceGroupManagersRequest request)1696   public final ListPagedResponse list(ListInstanceGroupManagersRequest request) {
1697     return listPagedCallable().call(request);
1698   }
1699 
1700   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1701   /**
1702    * Retrieves a list of managed instance groups that are contained within the specified project and
1703    * zone.
1704    *
1705    * <p>Sample code:
1706    *
1707    * <pre>{@code
1708    * // This snippet has been automatically generated and should be regarded as a code template only.
1709    * // It will require modifications to work:
1710    * // - It may require correct/in-range values for request initialization.
1711    * // - It may require specifying regional endpoints when creating the service client as shown in
1712    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1713    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1714    *     InstanceGroupManagersClient.create()) {
1715    *   ListInstanceGroupManagersRequest request =
1716    *       ListInstanceGroupManagersRequest.newBuilder()
1717    *           .setFilter("filter-1274492040")
1718    *           .setMaxResults(1128457243)
1719    *           .setOrderBy("orderBy-1207110587")
1720    *           .setPageToken("pageToken873572522")
1721    *           .setProject("project-309310695")
1722    *           .setReturnPartialSuccess(true)
1723    *           .setZone("zone3744684")
1724    *           .build();
1725    *   ApiFuture<InstanceGroupManager> future =
1726    *       instanceGroupManagersClient.listPagedCallable().futureCall(request);
1727    *   // Do something.
1728    *   for (InstanceGroupManager element : future.get().iterateAll()) {
1729    *     // doThingsWith(element);
1730    *   }
1731    * }
1732    * }</pre>
1733    */
1734   public final UnaryCallable<ListInstanceGroupManagersRequest, ListPagedResponse>
listPagedCallable()1735       listPagedCallable() {
1736     return stub.listPagedCallable();
1737   }
1738 
1739   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1740   /**
1741    * Retrieves a list of managed instance groups that are contained within the specified project and
1742    * zone.
1743    *
1744    * <p>Sample code:
1745    *
1746    * <pre>{@code
1747    * // This snippet has been automatically generated and should be regarded as a code template only.
1748    * // It will require modifications to work:
1749    * // - It may require correct/in-range values for request initialization.
1750    * // - It may require specifying regional endpoints when creating the service client as shown in
1751    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1752    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1753    *     InstanceGroupManagersClient.create()) {
1754    *   ListInstanceGroupManagersRequest request =
1755    *       ListInstanceGroupManagersRequest.newBuilder()
1756    *           .setFilter("filter-1274492040")
1757    *           .setMaxResults(1128457243)
1758    *           .setOrderBy("orderBy-1207110587")
1759    *           .setPageToken("pageToken873572522")
1760    *           .setProject("project-309310695")
1761    *           .setReturnPartialSuccess(true)
1762    *           .setZone("zone3744684")
1763    *           .build();
1764    *   while (true) {
1765    *     InstanceGroupManagerList response =
1766    *         instanceGroupManagersClient.listCallable().call(request);
1767    *     for (InstanceGroupManager element : response.getItemsList()) {
1768    *       // doThingsWith(element);
1769    *     }
1770    *     String nextPageToken = response.getNextPageToken();
1771    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1772    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1773    *     } else {
1774    *       break;
1775    *     }
1776    *   }
1777    * }
1778    * }</pre>
1779    */
1780   public final UnaryCallable<ListInstanceGroupManagersRequest, InstanceGroupManagerList>
listCallable()1781       listCallable() {
1782     return stub.listCallable();
1783   }
1784 
1785   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1786   /**
1787    * Lists all errors thrown by actions on instances for a given managed instance group. The filter
1788    * and orderBy query parameters are not supported.
1789    *
1790    * <p>Sample code:
1791    *
1792    * <pre>{@code
1793    * // This snippet has been automatically generated and should be regarded as a code template only.
1794    * // It will require modifications to work:
1795    * // - It may require correct/in-range values for request initialization.
1796    * // - It may require specifying regional endpoints when creating the service client as shown in
1797    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1798    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1799    *     InstanceGroupManagersClient.create()) {
1800    *   String project = "project-309310695";
1801    *   String zone = "zone3744684";
1802    *   String instanceGroupManager = "instanceGroupManager-388242077";
1803    *   for (InstanceManagedByIgmError element :
1804    *       instanceGroupManagersClient
1805    *           .listErrors(project, zone, instanceGroupManager)
1806    *           .iterateAll()) {
1807    *     // doThingsWith(element);
1808    *   }
1809    * }
1810    * }</pre>
1811    *
1812    * @param project Project ID for this request.
1813    * @param zone The name of the zone where the managed instance group is located. It should conform
1814    *     to RFC1035.
1815    * @param instanceGroupManager The name of the managed instance group. It must be a string that
1816    *     meets the requirements in RFC1035, or an unsigned long integer: must match regexp pattern:
1817    *     (?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)|1-9{0,19}.
1818    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1819    */
listErrors( String project, String zone, String instanceGroupManager)1820   public final ListErrorsPagedResponse listErrors(
1821       String project, String zone, String instanceGroupManager) {
1822     ListErrorsInstanceGroupManagersRequest request =
1823         ListErrorsInstanceGroupManagersRequest.newBuilder()
1824             .setProject(project)
1825             .setZone(zone)
1826             .setInstanceGroupManager(instanceGroupManager)
1827             .build();
1828     return listErrors(request);
1829   }
1830 
1831   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1832   /**
1833    * Lists all errors thrown by actions on instances for a given managed instance group. The filter
1834    * and orderBy query parameters are not supported.
1835    *
1836    * <p>Sample code:
1837    *
1838    * <pre>{@code
1839    * // This snippet has been automatically generated and should be regarded as a code template only.
1840    * // It will require modifications to work:
1841    * // - It may require correct/in-range values for request initialization.
1842    * // - It may require specifying regional endpoints when creating the service client as shown in
1843    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1844    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1845    *     InstanceGroupManagersClient.create()) {
1846    *   ListErrorsInstanceGroupManagersRequest request =
1847    *       ListErrorsInstanceGroupManagersRequest.newBuilder()
1848    *           .setFilter("filter-1274492040")
1849    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1850    *           .setMaxResults(1128457243)
1851    *           .setOrderBy("orderBy-1207110587")
1852    *           .setPageToken("pageToken873572522")
1853    *           .setProject("project-309310695")
1854    *           .setReturnPartialSuccess(true)
1855    *           .setZone("zone3744684")
1856    *           .build();
1857    *   for (InstanceManagedByIgmError element :
1858    *       instanceGroupManagersClient.listErrors(request).iterateAll()) {
1859    *     // doThingsWith(element);
1860    *   }
1861    * }
1862    * }</pre>
1863    *
1864    * @param request The request object containing all of the parameters for the API call.
1865    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1866    */
listErrors(ListErrorsInstanceGroupManagersRequest request)1867   public final ListErrorsPagedResponse listErrors(ListErrorsInstanceGroupManagersRequest request) {
1868     return listErrorsPagedCallable().call(request);
1869   }
1870 
1871   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1872   /**
1873    * Lists all errors thrown by actions on instances for a given managed instance group. The filter
1874    * and orderBy query parameters are not supported.
1875    *
1876    * <p>Sample code:
1877    *
1878    * <pre>{@code
1879    * // This snippet has been automatically generated and should be regarded as a code template only.
1880    * // It will require modifications to work:
1881    * // - It may require correct/in-range values for request initialization.
1882    * // - It may require specifying regional endpoints when creating the service client as shown in
1883    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1884    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1885    *     InstanceGroupManagersClient.create()) {
1886    *   ListErrorsInstanceGroupManagersRequest request =
1887    *       ListErrorsInstanceGroupManagersRequest.newBuilder()
1888    *           .setFilter("filter-1274492040")
1889    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1890    *           .setMaxResults(1128457243)
1891    *           .setOrderBy("orderBy-1207110587")
1892    *           .setPageToken("pageToken873572522")
1893    *           .setProject("project-309310695")
1894    *           .setReturnPartialSuccess(true)
1895    *           .setZone("zone3744684")
1896    *           .build();
1897    *   ApiFuture<InstanceManagedByIgmError> future =
1898    *       instanceGroupManagersClient.listErrorsPagedCallable().futureCall(request);
1899    *   // Do something.
1900    *   for (InstanceManagedByIgmError element : future.get().iterateAll()) {
1901    *     // doThingsWith(element);
1902    *   }
1903    * }
1904    * }</pre>
1905    */
1906   public final UnaryCallable<ListErrorsInstanceGroupManagersRequest, ListErrorsPagedResponse>
listErrorsPagedCallable()1907       listErrorsPagedCallable() {
1908     return stub.listErrorsPagedCallable();
1909   }
1910 
1911   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1912   /**
1913    * Lists all errors thrown by actions on instances for a given managed instance group. The filter
1914    * and orderBy query parameters are not supported.
1915    *
1916    * <p>Sample code:
1917    *
1918    * <pre>{@code
1919    * // This snippet has been automatically generated and should be regarded as a code template only.
1920    * // It will require modifications to work:
1921    * // - It may require correct/in-range values for request initialization.
1922    * // - It may require specifying regional endpoints when creating the service client as shown in
1923    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1924    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1925    *     InstanceGroupManagersClient.create()) {
1926    *   ListErrorsInstanceGroupManagersRequest request =
1927    *       ListErrorsInstanceGroupManagersRequest.newBuilder()
1928    *           .setFilter("filter-1274492040")
1929    *           .setInstanceGroupManager("instanceGroupManager-388242077")
1930    *           .setMaxResults(1128457243)
1931    *           .setOrderBy("orderBy-1207110587")
1932    *           .setPageToken("pageToken873572522")
1933    *           .setProject("project-309310695")
1934    *           .setReturnPartialSuccess(true)
1935    *           .setZone("zone3744684")
1936    *           .build();
1937    *   while (true) {
1938    *     InstanceGroupManagersListErrorsResponse response =
1939    *         instanceGroupManagersClient.listErrorsCallable().call(request);
1940    *     for (InstanceManagedByIgmError element : response.getItemsList()) {
1941    *       // doThingsWith(element);
1942    *     }
1943    *     String nextPageToken = response.getNextPageToken();
1944    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
1945    *       request = request.toBuilder().setPageToken(nextPageToken).build();
1946    *     } else {
1947    *       break;
1948    *     }
1949    *   }
1950    * }
1951    * }</pre>
1952    */
1953   public final UnaryCallable<
1954           ListErrorsInstanceGroupManagersRequest, InstanceGroupManagersListErrorsResponse>
listErrorsCallable()1955       listErrorsCallable() {
1956     return stub.listErrorsCallable();
1957   }
1958 
1959   // AUTO-GENERATED DOCUMENTATION AND METHOD.
1960   /**
1961    * Lists all of the instances in the managed instance group. Each instance in the list has a
1962    * currentAction, which indicates the action that the managed instance group is performing on the
1963    * instance. For example, if the group is still creating an instance, the currentAction is
1964    * CREATING. If a previous action failed, the list displays the errors for that failed action. The
1965    * orderBy query parameter is not supported. The `pageToken` query parameter is supported only in
1966    * the alpha and beta API and only if the group's `listManagedInstancesResults` field is set to
1967    * `PAGINATED`.
1968    *
1969    * <p>Sample code:
1970    *
1971    * <pre>{@code
1972    * // This snippet has been automatically generated and should be regarded as a code template only.
1973    * // It will require modifications to work:
1974    * // - It may require correct/in-range values for request initialization.
1975    * // - It may require specifying regional endpoints when creating the service client as shown in
1976    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
1977    * try (InstanceGroupManagersClient instanceGroupManagersClient =
1978    *     InstanceGroupManagersClient.create()) {
1979    *   String project = "project-309310695";
1980    *   String zone = "zone3744684";
1981    *   String instanceGroupManager = "instanceGroupManager-388242077";
1982    *   for (ManagedInstance element :
1983    *       instanceGroupManagersClient
1984    *           .listManagedInstances(project, zone, instanceGroupManager)
1985    *           .iterateAll()) {
1986    *     // doThingsWith(element);
1987    *   }
1988    * }
1989    * }</pre>
1990    *
1991    * @param project Project ID for this request.
1992    * @param zone The name of the zone where the managed instance group is located.
1993    * @param instanceGroupManager The name of the managed instance group.
1994    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
1995    */
listManagedInstances( String project, String zone, String instanceGroupManager)1996   public final ListManagedInstancesPagedResponse listManagedInstances(
1997       String project, String zone, String instanceGroupManager) {
1998     ListManagedInstancesInstanceGroupManagersRequest request =
1999         ListManagedInstancesInstanceGroupManagersRequest.newBuilder()
2000             .setProject(project)
2001             .setZone(zone)
2002             .setInstanceGroupManager(instanceGroupManager)
2003             .build();
2004     return listManagedInstances(request);
2005   }
2006 
2007   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2008   /**
2009    * Lists all of the instances in the managed instance group. Each instance in the list has a
2010    * currentAction, which indicates the action that the managed instance group is performing on the
2011    * instance. For example, if the group is still creating an instance, the currentAction is
2012    * CREATING. If a previous action failed, the list displays the errors for that failed action. The
2013    * orderBy query parameter is not supported. The `pageToken` query parameter is supported only in
2014    * the alpha and beta API and only if the group's `listManagedInstancesResults` field is set to
2015    * `PAGINATED`.
2016    *
2017    * <p>Sample code:
2018    *
2019    * <pre>{@code
2020    * // This snippet has been automatically generated and should be regarded as a code template only.
2021    * // It will require modifications to work:
2022    * // - It may require correct/in-range values for request initialization.
2023    * // - It may require specifying regional endpoints when creating the service client as shown in
2024    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2025    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2026    *     InstanceGroupManagersClient.create()) {
2027    *   ListManagedInstancesInstanceGroupManagersRequest request =
2028    *       ListManagedInstancesInstanceGroupManagersRequest.newBuilder()
2029    *           .setFilter("filter-1274492040")
2030    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2031    *           .setMaxResults(1128457243)
2032    *           .setOrderBy("orderBy-1207110587")
2033    *           .setPageToken("pageToken873572522")
2034    *           .setProject("project-309310695")
2035    *           .setReturnPartialSuccess(true)
2036    *           .setZone("zone3744684")
2037    *           .build();
2038    *   for (ManagedInstance element :
2039    *       instanceGroupManagersClient.listManagedInstances(request).iterateAll()) {
2040    *     // doThingsWith(element);
2041    *   }
2042    * }
2043    * }</pre>
2044    *
2045    * @param request The request object containing all of the parameters for the API call.
2046    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2047    */
listManagedInstances( ListManagedInstancesInstanceGroupManagersRequest request)2048   public final ListManagedInstancesPagedResponse listManagedInstances(
2049       ListManagedInstancesInstanceGroupManagersRequest request) {
2050     return listManagedInstancesPagedCallable().call(request);
2051   }
2052 
2053   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2054   /**
2055    * Lists all of the instances in the managed instance group. Each instance in the list has a
2056    * currentAction, which indicates the action that the managed instance group is performing on the
2057    * instance. For example, if the group is still creating an instance, the currentAction is
2058    * CREATING. If a previous action failed, the list displays the errors for that failed action. The
2059    * orderBy query parameter is not supported. The `pageToken` query parameter is supported only in
2060    * the alpha and beta API and only if the group's `listManagedInstancesResults` field is set to
2061    * `PAGINATED`.
2062    *
2063    * <p>Sample code:
2064    *
2065    * <pre>{@code
2066    * // This snippet has been automatically generated and should be regarded as a code template only.
2067    * // It will require modifications to work:
2068    * // - It may require correct/in-range values for request initialization.
2069    * // - It may require specifying regional endpoints when creating the service client as shown in
2070    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2071    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2072    *     InstanceGroupManagersClient.create()) {
2073    *   ListManagedInstancesInstanceGroupManagersRequest request =
2074    *       ListManagedInstancesInstanceGroupManagersRequest.newBuilder()
2075    *           .setFilter("filter-1274492040")
2076    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2077    *           .setMaxResults(1128457243)
2078    *           .setOrderBy("orderBy-1207110587")
2079    *           .setPageToken("pageToken873572522")
2080    *           .setProject("project-309310695")
2081    *           .setReturnPartialSuccess(true)
2082    *           .setZone("zone3744684")
2083    *           .build();
2084    *   ApiFuture<ManagedInstance> future =
2085    *       instanceGroupManagersClient.listManagedInstancesPagedCallable().futureCall(request);
2086    *   // Do something.
2087    *   for (ManagedInstance element : future.get().iterateAll()) {
2088    *     // doThingsWith(element);
2089    *   }
2090    * }
2091    * }</pre>
2092    */
2093   public final UnaryCallable<
2094           ListManagedInstancesInstanceGroupManagersRequest, ListManagedInstancesPagedResponse>
listManagedInstancesPagedCallable()2095       listManagedInstancesPagedCallable() {
2096     return stub.listManagedInstancesPagedCallable();
2097   }
2098 
2099   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2100   /**
2101    * Lists all of the instances in the managed instance group. Each instance in the list has a
2102    * currentAction, which indicates the action that the managed instance group is performing on the
2103    * instance. For example, if the group is still creating an instance, the currentAction is
2104    * CREATING. If a previous action failed, the list displays the errors for that failed action. The
2105    * orderBy query parameter is not supported. The `pageToken` query parameter is supported only in
2106    * the alpha and beta API and only if the group's `listManagedInstancesResults` field is set to
2107    * `PAGINATED`.
2108    *
2109    * <p>Sample code:
2110    *
2111    * <pre>{@code
2112    * // This snippet has been automatically generated and should be regarded as a code template only.
2113    * // It will require modifications to work:
2114    * // - It may require correct/in-range values for request initialization.
2115    * // - It may require specifying regional endpoints when creating the service client as shown in
2116    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2117    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2118    *     InstanceGroupManagersClient.create()) {
2119    *   ListManagedInstancesInstanceGroupManagersRequest request =
2120    *       ListManagedInstancesInstanceGroupManagersRequest.newBuilder()
2121    *           .setFilter("filter-1274492040")
2122    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2123    *           .setMaxResults(1128457243)
2124    *           .setOrderBy("orderBy-1207110587")
2125    *           .setPageToken("pageToken873572522")
2126    *           .setProject("project-309310695")
2127    *           .setReturnPartialSuccess(true)
2128    *           .setZone("zone3744684")
2129    *           .build();
2130    *   while (true) {
2131    *     InstanceGroupManagersListManagedInstancesResponse response =
2132    *         instanceGroupManagersClient.listManagedInstancesCallable().call(request);
2133    *     for (ManagedInstance element : response.getManagedInstancesList()) {
2134    *       // doThingsWith(element);
2135    *     }
2136    *     String nextPageToken = response.getNextPageToken();
2137    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
2138    *       request = request.toBuilder().setPageToken(nextPageToken).build();
2139    *     } else {
2140    *       break;
2141    *     }
2142    *   }
2143    * }
2144    * }</pre>
2145    */
2146   public final UnaryCallable<
2147           ListManagedInstancesInstanceGroupManagersRequest,
2148           InstanceGroupManagersListManagedInstancesResponse>
listManagedInstancesCallable()2149       listManagedInstancesCallable() {
2150     return stub.listManagedInstancesCallable();
2151   }
2152 
2153   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2154   /**
2155    * Lists all of the per-instance configurations defined for the managed instance group. The
2156    * orderBy query parameter is not supported.
2157    *
2158    * <p>Sample code:
2159    *
2160    * <pre>{@code
2161    * // This snippet has been automatically generated and should be regarded as a code template only.
2162    * // It will require modifications to work:
2163    * // - It may require correct/in-range values for request initialization.
2164    * // - It may require specifying regional endpoints when creating the service client as shown in
2165    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2166    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2167    *     InstanceGroupManagersClient.create()) {
2168    *   String project = "project-309310695";
2169    *   String zone = "zone3744684";
2170    *   String instanceGroupManager = "instanceGroupManager-388242077";
2171    *   for (PerInstanceConfig element :
2172    *       instanceGroupManagersClient
2173    *           .listPerInstanceConfigs(project, zone, instanceGroupManager)
2174    *           .iterateAll()) {
2175    *     // doThingsWith(element);
2176    *   }
2177    * }
2178    * }</pre>
2179    *
2180    * @param project Project ID for this request.
2181    * @param zone The name of the zone where the managed instance group is located. It should conform
2182    *     to RFC1035.
2183    * @param instanceGroupManager The name of the managed instance group. It should conform to
2184    *     RFC1035.
2185    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2186    */
listPerInstanceConfigs( String project, String zone, String instanceGroupManager)2187   public final ListPerInstanceConfigsPagedResponse listPerInstanceConfigs(
2188       String project, String zone, String instanceGroupManager) {
2189     ListPerInstanceConfigsInstanceGroupManagersRequest request =
2190         ListPerInstanceConfigsInstanceGroupManagersRequest.newBuilder()
2191             .setProject(project)
2192             .setZone(zone)
2193             .setInstanceGroupManager(instanceGroupManager)
2194             .build();
2195     return listPerInstanceConfigs(request);
2196   }
2197 
2198   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2199   /**
2200    * Lists all of the per-instance configurations defined for the managed instance group. The
2201    * orderBy query parameter is not supported.
2202    *
2203    * <p>Sample code:
2204    *
2205    * <pre>{@code
2206    * // This snippet has been automatically generated and should be regarded as a code template only.
2207    * // It will require modifications to work:
2208    * // - It may require correct/in-range values for request initialization.
2209    * // - It may require specifying regional endpoints when creating the service client as shown in
2210    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2211    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2212    *     InstanceGroupManagersClient.create()) {
2213    *   ListPerInstanceConfigsInstanceGroupManagersRequest request =
2214    *       ListPerInstanceConfigsInstanceGroupManagersRequest.newBuilder()
2215    *           .setFilter("filter-1274492040")
2216    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2217    *           .setMaxResults(1128457243)
2218    *           .setOrderBy("orderBy-1207110587")
2219    *           .setPageToken("pageToken873572522")
2220    *           .setProject("project-309310695")
2221    *           .setReturnPartialSuccess(true)
2222    *           .setZone("zone3744684")
2223    *           .build();
2224    *   for (PerInstanceConfig element :
2225    *       instanceGroupManagersClient.listPerInstanceConfigs(request).iterateAll()) {
2226    *     // doThingsWith(element);
2227    *   }
2228    * }
2229    * }</pre>
2230    *
2231    * @param request The request object containing all of the parameters for the API call.
2232    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2233    */
listPerInstanceConfigs( ListPerInstanceConfigsInstanceGroupManagersRequest request)2234   public final ListPerInstanceConfigsPagedResponse listPerInstanceConfigs(
2235       ListPerInstanceConfigsInstanceGroupManagersRequest request) {
2236     return listPerInstanceConfigsPagedCallable().call(request);
2237   }
2238 
2239   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2240   /**
2241    * Lists all of the per-instance configurations defined for the managed instance group. The
2242    * orderBy query parameter is not supported.
2243    *
2244    * <p>Sample code:
2245    *
2246    * <pre>{@code
2247    * // This snippet has been automatically generated and should be regarded as a code template only.
2248    * // It will require modifications to work:
2249    * // - It may require correct/in-range values for request initialization.
2250    * // - It may require specifying regional endpoints when creating the service client as shown in
2251    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2252    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2253    *     InstanceGroupManagersClient.create()) {
2254    *   ListPerInstanceConfigsInstanceGroupManagersRequest request =
2255    *       ListPerInstanceConfigsInstanceGroupManagersRequest.newBuilder()
2256    *           .setFilter("filter-1274492040")
2257    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2258    *           .setMaxResults(1128457243)
2259    *           .setOrderBy("orderBy-1207110587")
2260    *           .setPageToken("pageToken873572522")
2261    *           .setProject("project-309310695")
2262    *           .setReturnPartialSuccess(true)
2263    *           .setZone("zone3744684")
2264    *           .build();
2265    *   ApiFuture<PerInstanceConfig> future =
2266    *       instanceGroupManagersClient.listPerInstanceConfigsPagedCallable().futureCall(request);
2267    *   // Do something.
2268    *   for (PerInstanceConfig element : future.get().iterateAll()) {
2269    *     // doThingsWith(element);
2270    *   }
2271    * }
2272    * }</pre>
2273    */
2274   public final UnaryCallable<
2275           ListPerInstanceConfigsInstanceGroupManagersRequest, ListPerInstanceConfigsPagedResponse>
listPerInstanceConfigsPagedCallable()2276       listPerInstanceConfigsPagedCallable() {
2277     return stub.listPerInstanceConfigsPagedCallable();
2278   }
2279 
2280   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2281   /**
2282    * Lists all of the per-instance configurations defined for the managed instance group. The
2283    * orderBy query parameter is not supported.
2284    *
2285    * <p>Sample code:
2286    *
2287    * <pre>{@code
2288    * // This snippet has been automatically generated and should be regarded as a code template only.
2289    * // It will require modifications to work:
2290    * // - It may require correct/in-range values for request initialization.
2291    * // - It may require specifying regional endpoints when creating the service client as shown in
2292    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2293    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2294    *     InstanceGroupManagersClient.create()) {
2295    *   ListPerInstanceConfigsInstanceGroupManagersRequest request =
2296    *       ListPerInstanceConfigsInstanceGroupManagersRequest.newBuilder()
2297    *           .setFilter("filter-1274492040")
2298    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2299    *           .setMaxResults(1128457243)
2300    *           .setOrderBy("orderBy-1207110587")
2301    *           .setPageToken("pageToken873572522")
2302    *           .setProject("project-309310695")
2303    *           .setReturnPartialSuccess(true)
2304    *           .setZone("zone3744684")
2305    *           .build();
2306    *   while (true) {
2307    *     InstanceGroupManagersListPerInstanceConfigsResp response =
2308    *         instanceGroupManagersClient.listPerInstanceConfigsCallable().call(request);
2309    *     for (PerInstanceConfig element : response.getItemsList()) {
2310    *       // doThingsWith(element);
2311    *     }
2312    *     String nextPageToken = response.getNextPageToken();
2313    *     if (!Strings.isNullOrEmpty(nextPageToken)) {
2314    *       request = request.toBuilder().setPageToken(nextPageToken).build();
2315    *     } else {
2316    *       break;
2317    *     }
2318    *   }
2319    * }
2320    * }</pre>
2321    */
2322   public final UnaryCallable<
2323           ListPerInstanceConfigsInstanceGroupManagersRequest,
2324           InstanceGroupManagersListPerInstanceConfigsResp>
listPerInstanceConfigsCallable()2325       listPerInstanceConfigsCallable() {
2326     return stub.listPerInstanceConfigsCallable();
2327   }
2328 
2329   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2330   /**
2331    * Updates a managed instance group using the information that you specify in the request. This
2332    * operation is marked as DONE when the group is patched even if the instances in the group are
2333    * still in the process of being patched. You must separately verify the status of the individual
2334    * instances with the listManagedInstances method. This method supports PATCH semantics and uses
2335    * the JSON merge patch format and processing rules. If you update your group to specify a new
2336    * template or instance configuration, it's possible that your intended specification for each VM
2337    * in the group is different from the current state of that VM. To learn how to apply an updated
2338    * configuration to the VMs in a MIG, see Updating instances in a MIG.
2339    *
2340    * <p>Sample code:
2341    *
2342    * <pre>{@code
2343    * // This snippet has been automatically generated and should be regarded as a code template only.
2344    * // It will require modifications to work:
2345    * // - It may require correct/in-range values for request initialization.
2346    * // - It may require specifying regional endpoints when creating the service client as shown in
2347    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2348    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2349    *     InstanceGroupManagersClient.create()) {
2350    *   String project = "project-309310695";
2351    *   String zone = "zone3744684";
2352    *   String instanceGroupManager = "instanceGroupManager-388242077";
2353    *   InstanceGroupManager instanceGroupManagerResource = InstanceGroupManager.newBuilder().build();
2354    *   Operation response =
2355    *       instanceGroupManagersClient
2356    *           .patchAsync(project, zone, instanceGroupManager, instanceGroupManagerResource)
2357    *           .get();
2358    * }
2359    * }</pre>
2360    *
2361    * @param project Project ID for this request.
2362    * @param zone The name of the zone where you want to create the managed instance group.
2363    * @param instanceGroupManager The name of the instance group manager.
2364    * @param instanceGroupManagerResource The body resource for this request
2365    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2366    */
patchAsync( String project, String zone, String instanceGroupManager, InstanceGroupManager instanceGroupManagerResource)2367   public final OperationFuture<Operation, Operation> patchAsync(
2368       String project,
2369       String zone,
2370       String instanceGroupManager,
2371       InstanceGroupManager instanceGroupManagerResource) {
2372     PatchInstanceGroupManagerRequest request =
2373         PatchInstanceGroupManagerRequest.newBuilder()
2374             .setProject(project)
2375             .setZone(zone)
2376             .setInstanceGroupManager(instanceGroupManager)
2377             .setInstanceGroupManagerResource(instanceGroupManagerResource)
2378             .build();
2379     return patchAsync(request);
2380   }
2381 
2382   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2383   /**
2384    * Updates a managed instance group using the information that you specify in the request. This
2385    * operation is marked as DONE when the group is patched even if the instances in the group are
2386    * still in the process of being patched. You must separately verify the status of the individual
2387    * instances with the listManagedInstances method. This method supports PATCH semantics and uses
2388    * the JSON merge patch format and processing rules. If you update your group to specify a new
2389    * template or instance configuration, it's possible that your intended specification for each VM
2390    * in the group is different from the current state of that VM. To learn how to apply an updated
2391    * configuration to the VMs in a MIG, see Updating instances in a MIG.
2392    *
2393    * <p>Sample code:
2394    *
2395    * <pre>{@code
2396    * // This snippet has been automatically generated and should be regarded as a code template only.
2397    * // It will require modifications to work:
2398    * // - It may require correct/in-range values for request initialization.
2399    * // - It may require specifying regional endpoints when creating the service client as shown in
2400    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2401    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2402    *     InstanceGroupManagersClient.create()) {
2403    *   PatchInstanceGroupManagerRequest request =
2404    *       PatchInstanceGroupManagerRequest.newBuilder()
2405    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2406    *           .setInstanceGroupManagerResource(InstanceGroupManager.newBuilder().build())
2407    *           .setProject("project-309310695")
2408    *           .setRequestId("requestId693933066")
2409    *           .setZone("zone3744684")
2410    *           .build();
2411    *   Operation response = instanceGroupManagersClient.patchAsync(request).get();
2412    * }
2413    * }</pre>
2414    *
2415    * @param request The request object containing all of the parameters for the API call.
2416    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2417    */
2418   @BetaApi(
2419       "The surface for long-running operations is not stable yet and may change in the future.")
patchAsync( PatchInstanceGroupManagerRequest request)2420   public final OperationFuture<Operation, Operation> patchAsync(
2421       PatchInstanceGroupManagerRequest request) {
2422     return patchOperationCallable().futureCall(request);
2423   }
2424 
2425   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2426   /**
2427    * Updates a managed instance group using the information that you specify in the request. This
2428    * operation is marked as DONE when the group is patched even if the instances in the group are
2429    * still in the process of being patched. You must separately verify the status of the individual
2430    * instances with the listManagedInstances method. This method supports PATCH semantics and uses
2431    * the JSON merge patch format and processing rules. If you update your group to specify a new
2432    * template or instance configuration, it's possible that your intended specification for each VM
2433    * in the group is different from the current state of that VM. To learn how to apply an updated
2434    * configuration to the VMs in a MIG, see Updating instances in a MIG.
2435    *
2436    * <p>Sample code:
2437    *
2438    * <pre>{@code
2439    * // This snippet has been automatically generated and should be regarded as a code template only.
2440    * // It will require modifications to work:
2441    * // - It may require correct/in-range values for request initialization.
2442    * // - It may require specifying regional endpoints when creating the service client as shown in
2443    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2444    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2445    *     InstanceGroupManagersClient.create()) {
2446    *   PatchInstanceGroupManagerRequest request =
2447    *       PatchInstanceGroupManagerRequest.newBuilder()
2448    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2449    *           .setInstanceGroupManagerResource(InstanceGroupManager.newBuilder().build())
2450    *           .setProject("project-309310695")
2451    *           .setRequestId("requestId693933066")
2452    *           .setZone("zone3744684")
2453    *           .build();
2454    *   OperationFuture<Operation, Operation> future =
2455    *       instanceGroupManagersClient.patchOperationCallable().futureCall(request);
2456    *   // Do something.
2457    *   Operation response = future.get();
2458    * }
2459    * }</pre>
2460    */
2461   public final OperationCallable<PatchInstanceGroupManagerRequest, Operation, Operation>
patchOperationCallable()2462       patchOperationCallable() {
2463     return stub.patchOperationCallable();
2464   }
2465 
2466   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2467   /**
2468    * Updates a managed instance group using the information that you specify in the request. This
2469    * operation is marked as DONE when the group is patched even if the instances in the group are
2470    * still in the process of being patched. You must separately verify the status of the individual
2471    * instances with the listManagedInstances method. This method supports PATCH semantics and uses
2472    * the JSON merge patch format and processing rules. If you update your group to specify a new
2473    * template or instance configuration, it's possible that your intended specification for each VM
2474    * in the group is different from the current state of that VM. To learn how to apply an updated
2475    * configuration to the VMs in a MIG, see Updating instances in a MIG.
2476    *
2477    * <p>Sample code:
2478    *
2479    * <pre>{@code
2480    * // This snippet has been automatically generated and should be regarded as a code template only.
2481    * // It will require modifications to work:
2482    * // - It may require correct/in-range values for request initialization.
2483    * // - It may require specifying regional endpoints when creating the service client as shown in
2484    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2485    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2486    *     InstanceGroupManagersClient.create()) {
2487    *   PatchInstanceGroupManagerRequest request =
2488    *       PatchInstanceGroupManagerRequest.newBuilder()
2489    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2490    *           .setInstanceGroupManagerResource(InstanceGroupManager.newBuilder().build())
2491    *           .setProject("project-309310695")
2492    *           .setRequestId("requestId693933066")
2493    *           .setZone("zone3744684")
2494    *           .build();
2495    *   ApiFuture<Operation> future = instanceGroupManagersClient.patchCallable().futureCall(request);
2496    *   // Do something.
2497    *   Operation response = future.get();
2498    * }
2499    * }</pre>
2500    */
patchCallable()2501   public final UnaryCallable<PatchInstanceGroupManagerRequest, Operation> patchCallable() {
2502     return stub.patchCallable();
2503   }
2504 
2505   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2506   /**
2507    * Inserts or patches per-instance configurations for the managed instance group.
2508    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
2509    *
2510    * <p>Sample code:
2511    *
2512    * <pre>{@code
2513    * // This snippet has been automatically generated and should be regarded as a code template only.
2514    * // It will require modifications to work:
2515    * // - It may require correct/in-range values for request initialization.
2516    * // - It may require specifying regional endpoints when creating the service client as shown in
2517    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2518    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2519    *     InstanceGroupManagersClient.create()) {
2520    *   String project = "project-309310695";
2521    *   String zone = "zone3744684";
2522    *   String instanceGroupManager = "instanceGroupManager-388242077";
2523    *   InstanceGroupManagersPatchPerInstanceConfigsReq
2524    *       instanceGroupManagersPatchPerInstanceConfigsReqResource =
2525    *           InstanceGroupManagersPatchPerInstanceConfigsReq.newBuilder().build();
2526    *   Operation response =
2527    *       instanceGroupManagersClient
2528    *           .patchPerInstanceConfigsAsync(
2529    *               project,
2530    *               zone,
2531    *               instanceGroupManager,
2532    *               instanceGroupManagersPatchPerInstanceConfigsReqResource)
2533    *           .get();
2534    * }
2535    * }</pre>
2536    *
2537    * @param project Project ID for this request.
2538    * @param zone The name of the zone where the managed instance group is located. It should conform
2539    *     to RFC1035.
2540    * @param instanceGroupManager The name of the managed instance group. It should conform to
2541    *     RFC1035.
2542    * @param instanceGroupManagersPatchPerInstanceConfigsReqResource The body resource for this
2543    *     request
2544    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2545    */
patchPerInstanceConfigsAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersPatchPerInstanceConfigsReq instanceGroupManagersPatchPerInstanceConfigsReqResource)2546   public final OperationFuture<Operation, Operation> patchPerInstanceConfigsAsync(
2547       String project,
2548       String zone,
2549       String instanceGroupManager,
2550       InstanceGroupManagersPatchPerInstanceConfigsReq
2551           instanceGroupManagersPatchPerInstanceConfigsReqResource) {
2552     PatchPerInstanceConfigsInstanceGroupManagerRequest request =
2553         PatchPerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
2554             .setProject(project)
2555             .setZone(zone)
2556             .setInstanceGroupManager(instanceGroupManager)
2557             .setInstanceGroupManagersPatchPerInstanceConfigsReqResource(
2558                 instanceGroupManagersPatchPerInstanceConfigsReqResource)
2559             .build();
2560     return patchPerInstanceConfigsAsync(request);
2561   }
2562 
2563   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2564   /**
2565    * Inserts or patches per-instance configurations for the managed instance group.
2566    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
2567    *
2568    * <p>Sample code:
2569    *
2570    * <pre>{@code
2571    * // This snippet has been automatically generated and should be regarded as a code template only.
2572    * // It will require modifications to work:
2573    * // - It may require correct/in-range values for request initialization.
2574    * // - It may require specifying regional endpoints when creating the service client as shown in
2575    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2576    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2577    *     InstanceGroupManagersClient.create()) {
2578    *   PatchPerInstanceConfigsInstanceGroupManagerRequest request =
2579    *       PatchPerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
2580    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2581    *           .setInstanceGroupManagersPatchPerInstanceConfigsReqResource(
2582    *               InstanceGroupManagersPatchPerInstanceConfigsReq.newBuilder().build())
2583    *           .setProject("project-309310695")
2584    *           .setRequestId("requestId693933066")
2585    *           .setZone("zone3744684")
2586    *           .build();
2587    *   Operation response = instanceGroupManagersClient.patchPerInstanceConfigsAsync(request).get();
2588    * }
2589    * }</pre>
2590    *
2591    * @param request The request object containing all of the parameters for the API call.
2592    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2593    */
2594   @BetaApi(
2595       "The surface for long-running operations is not stable yet and may change in the future.")
patchPerInstanceConfigsAsync( PatchPerInstanceConfigsInstanceGroupManagerRequest request)2596   public final OperationFuture<Operation, Operation> patchPerInstanceConfigsAsync(
2597       PatchPerInstanceConfigsInstanceGroupManagerRequest request) {
2598     return patchPerInstanceConfigsOperationCallable().futureCall(request);
2599   }
2600 
2601   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2602   /**
2603    * Inserts or patches per-instance configurations for the managed instance group.
2604    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
2605    *
2606    * <p>Sample code:
2607    *
2608    * <pre>{@code
2609    * // This snippet has been automatically generated and should be regarded as a code template only.
2610    * // It will require modifications to work:
2611    * // - It may require correct/in-range values for request initialization.
2612    * // - It may require specifying regional endpoints when creating the service client as shown in
2613    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2614    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2615    *     InstanceGroupManagersClient.create()) {
2616    *   PatchPerInstanceConfigsInstanceGroupManagerRequest request =
2617    *       PatchPerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
2618    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2619    *           .setInstanceGroupManagersPatchPerInstanceConfigsReqResource(
2620    *               InstanceGroupManagersPatchPerInstanceConfigsReq.newBuilder().build())
2621    *           .setProject("project-309310695")
2622    *           .setRequestId("requestId693933066")
2623    *           .setZone("zone3744684")
2624    *           .build();
2625    *   OperationFuture<Operation, Operation> future =
2626    *       instanceGroupManagersClient
2627    *           .patchPerInstanceConfigsOperationCallable()
2628    *           .futureCall(request);
2629    *   // Do something.
2630    *   Operation response = future.get();
2631    * }
2632    * }</pre>
2633    */
2634   public final OperationCallable<
2635           PatchPerInstanceConfigsInstanceGroupManagerRequest, Operation, Operation>
patchPerInstanceConfigsOperationCallable()2636       patchPerInstanceConfigsOperationCallable() {
2637     return stub.patchPerInstanceConfigsOperationCallable();
2638   }
2639 
2640   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2641   /**
2642    * Inserts or patches per-instance configurations for the managed instance group.
2643    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
2644    *
2645    * <p>Sample code:
2646    *
2647    * <pre>{@code
2648    * // This snippet has been automatically generated and should be regarded as a code template only.
2649    * // It will require modifications to work:
2650    * // - It may require correct/in-range values for request initialization.
2651    * // - It may require specifying regional endpoints when creating the service client as shown in
2652    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2653    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2654    *     InstanceGroupManagersClient.create()) {
2655    *   PatchPerInstanceConfigsInstanceGroupManagerRequest request =
2656    *       PatchPerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
2657    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2658    *           .setInstanceGroupManagersPatchPerInstanceConfigsReqResource(
2659    *               InstanceGroupManagersPatchPerInstanceConfigsReq.newBuilder().build())
2660    *           .setProject("project-309310695")
2661    *           .setRequestId("requestId693933066")
2662    *           .setZone("zone3744684")
2663    *           .build();
2664    *   ApiFuture<Operation> future =
2665    *       instanceGroupManagersClient.patchPerInstanceConfigsCallable().futureCall(request);
2666    *   // Do something.
2667    *   Operation response = future.get();
2668    * }
2669    * }</pre>
2670    */
2671   public final UnaryCallable<PatchPerInstanceConfigsInstanceGroupManagerRequest, Operation>
patchPerInstanceConfigsCallable()2672       patchPerInstanceConfigsCallable() {
2673     return stub.patchPerInstanceConfigsCallable();
2674   }
2675 
2676   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2677   /**
2678    * Flags the specified VM instances in the managed instance group to be immediately recreated.
2679    * Each instance is recreated using the group's current configuration. This operation is marked as
2680    * DONE when the flag is set even if the instances have not yet been recreated. You must
2681    * separately verify the status of each instance by checking its currentAction field; for more
2682    * information, see Checking the status of managed instances. If the group is part of a backend
2683    * service that has enabled connection draining, it can take up to 60 seconds after the connection
2684    * draining duration has elapsed before the VM instance is removed or deleted. You can specify a
2685    * maximum of 1000 instances with this method per request.
2686    *
2687    * <p>Sample code:
2688    *
2689    * <pre>{@code
2690    * // This snippet has been automatically generated and should be regarded as a code template only.
2691    * // It will require modifications to work:
2692    * // - It may require correct/in-range values for request initialization.
2693    * // - It may require specifying regional endpoints when creating the service client as shown in
2694    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2695    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2696    *     InstanceGroupManagersClient.create()) {
2697    *   String project = "project-309310695";
2698    *   String zone = "zone3744684";
2699    *   String instanceGroupManager = "instanceGroupManager-388242077";
2700    *   InstanceGroupManagersRecreateInstancesRequest
2701    *       instanceGroupManagersRecreateInstancesRequestResource =
2702    *           InstanceGroupManagersRecreateInstancesRequest.newBuilder().build();
2703    *   Operation response =
2704    *       instanceGroupManagersClient
2705    *           .recreateInstancesAsync(
2706    *               project,
2707    *               zone,
2708    *               instanceGroupManager,
2709    *               instanceGroupManagersRecreateInstancesRequestResource)
2710    *           .get();
2711    * }
2712    * }</pre>
2713    *
2714    * @param project Project ID for this request.
2715    * @param zone The name of the zone where the managed instance group is located.
2716    * @param instanceGroupManager The name of the managed instance group.
2717    * @param instanceGroupManagersRecreateInstancesRequestResource The body resource for this request
2718    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2719    */
recreateInstancesAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersRecreateInstancesRequest instanceGroupManagersRecreateInstancesRequestResource)2720   public final OperationFuture<Operation, Operation> recreateInstancesAsync(
2721       String project,
2722       String zone,
2723       String instanceGroupManager,
2724       InstanceGroupManagersRecreateInstancesRequest
2725           instanceGroupManagersRecreateInstancesRequestResource) {
2726     RecreateInstancesInstanceGroupManagerRequest request =
2727         RecreateInstancesInstanceGroupManagerRequest.newBuilder()
2728             .setProject(project)
2729             .setZone(zone)
2730             .setInstanceGroupManager(instanceGroupManager)
2731             .setInstanceGroupManagersRecreateInstancesRequestResource(
2732                 instanceGroupManagersRecreateInstancesRequestResource)
2733             .build();
2734     return recreateInstancesAsync(request);
2735   }
2736 
2737   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2738   /**
2739    * Flags the specified VM instances in the managed instance group to be immediately recreated.
2740    * Each instance is recreated using the group's current configuration. This operation is marked as
2741    * DONE when the flag is set even if the instances have not yet been recreated. You must
2742    * separately verify the status of each instance by checking its currentAction field; for more
2743    * information, see Checking the status of managed instances. If the group is part of a backend
2744    * service that has enabled connection draining, it can take up to 60 seconds after the connection
2745    * draining duration has elapsed before the VM instance is removed or deleted. You can specify a
2746    * maximum of 1000 instances with this method per request.
2747    *
2748    * <p>Sample code:
2749    *
2750    * <pre>{@code
2751    * // This snippet has been automatically generated and should be regarded as a code template only.
2752    * // It will require modifications to work:
2753    * // - It may require correct/in-range values for request initialization.
2754    * // - It may require specifying regional endpoints when creating the service client as shown in
2755    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2756    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2757    *     InstanceGroupManagersClient.create()) {
2758    *   RecreateInstancesInstanceGroupManagerRequest request =
2759    *       RecreateInstancesInstanceGroupManagerRequest.newBuilder()
2760    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2761    *           .setInstanceGroupManagersRecreateInstancesRequestResource(
2762    *               InstanceGroupManagersRecreateInstancesRequest.newBuilder().build())
2763    *           .setProject("project-309310695")
2764    *           .setRequestId("requestId693933066")
2765    *           .setZone("zone3744684")
2766    *           .build();
2767    *   Operation response = instanceGroupManagersClient.recreateInstancesAsync(request).get();
2768    * }
2769    * }</pre>
2770    *
2771    * @param request The request object containing all of the parameters for the API call.
2772    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2773    */
2774   @BetaApi(
2775       "The surface for long-running operations is not stable yet and may change in the future.")
recreateInstancesAsync( RecreateInstancesInstanceGroupManagerRequest request)2776   public final OperationFuture<Operation, Operation> recreateInstancesAsync(
2777       RecreateInstancesInstanceGroupManagerRequest request) {
2778     return recreateInstancesOperationCallable().futureCall(request);
2779   }
2780 
2781   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2782   /**
2783    * Flags the specified VM instances in the managed instance group to be immediately recreated.
2784    * Each instance is recreated using the group's current configuration. This operation is marked as
2785    * DONE when the flag is set even if the instances have not yet been recreated. You must
2786    * separately verify the status of each instance by checking its currentAction field; for more
2787    * information, see Checking the status of managed instances. If the group is part of a backend
2788    * service that has enabled connection draining, it can take up to 60 seconds after the connection
2789    * draining duration has elapsed before the VM instance is removed or deleted. You can specify a
2790    * maximum of 1000 instances with this method per request.
2791    *
2792    * <p>Sample code:
2793    *
2794    * <pre>{@code
2795    * // This snippet has been automatically generated and should be regarded as a code template only.
2796    * // It will require modifications to work:
2797    * // - It may require correct/in-range values for request initialization.
2798    * // - It may require specifying regional endpoints when creating the service client as shown in
2799    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2800    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2801    *     InstanceGroupManagersClient.create()) {
2802    *   RecreateInstancesInstanceGroupManagerRequest request =
2803    *       RecreateInstancesInstanceGroupManagerRequest.newBuilder()
2804    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2805    *           .setInstanceGroupManagersRecreateInstancesRequestResource(
2806    *               InstanceGroupManagersRecreateInstancesRequest.newBuilder().build())
2807    *           .setProject("project-309310695")
2808    *           .setRequestId("requestId693933066")
2809    *           .setZone("zone3744684")
2810    *           .build();
2811    *   OperationFuture<Operation, Operation> future =
2812    *       instanceGroupManagersClient.recreateInstancesOperationCallable().futureCall(request);
2813    *   // Do something.
2814    *   Operation response = future.get();
2815    * }
2816    * }</pre>
2817    */
2818   public final OperationCallable<RecreateInstancesInstanceGroupManagerRequest, Operation, Operation>
recreateInstancesOperationCallable()2819       recreateInstancesOperationCallable() {
2820     return stub.recreateInstancesOperationCallable();
2821   }
2822 
2823   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2824   /**
2825    * Flags the specified VM instances in the managed instance group to be immediately recreated.
2826    * Each instance is recreated using the group's current configuration. This operation is marked as
2827    * DONE when the flag is set even if the instances have not yet been recreated. You must
2828    * separately verify the status of each instance by checking its currentAction field; for more
2829    * information, see Checking the status of managed instances. If the group is part of a backend
2830    * service that has enabled connection draining, it can take up to 60 seconds after the connection
2831    * draining duration has elapsed before the VM instance is removed or deleted. You can specify a
2832    * maximum of 1000 instances with this method per request.
2833    *
2834    * <p>Sample code:
2835    *
2836    * <pre>{@code
2837    * // This snippet has been automatically generated and should be regarded as a code template only.
2838    * // It will require modifications to work:
2839    * // - It may require correct/in-range values for request initialization.
2840    * // - It may require specifying regional endpoints when creating the service client as shown in
2841    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2842    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2843    *     InstanceGroupManagersClient.create()) {
2844    *   RecreateInstancesInstanceGroupManagerRequest request =
2845    *       RecreateInstancesInstanceGroupManagerRequest.newBuilder()
2846    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2847    *           .setInstanceGroupManagersRecreateInstancesRequestResource(
2848    *               InstanceGroupManagersRecreateInstancesRequest.newBuilder().build())
2849    *           .setProject("project-309310695")
2850    *           .setRequestId("requestId693933066")
2851    *           .setZone("zone3744684")
2852    *           .build();
2853    *   ApiFuture<Operation> future =
2854    *       instanceGroupManagersClient.recreateInstancesCallable().futureCall(request);
2855    *   // Do something.
2856    *   Operation response = future.get();
2857    * }
2858    * }</pre>
2859    */
2860   public final UnaryCallable<RecreateInstancesInstanceGroupManagerRequest, Operation>
recreateInstancesCallable()2861       recreateInstancesCallable() {
2862     return stub.recreateInstancesCallable();
2863   }
2864 
2865   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2866   /**
2867    * Resizes the managed instance group. If you increase the size, the group creates new instances
2868    * using the current instance template. If you decrease the size, the group deletes instances. The
2869    * resize operation is marked DONE when the resize actions are scheduled even if the group has not
2870    * yet added or deleted any instances. You must separately verify the status of the creating or
2871    * deleting actions with the listmanagedinstances method. When resizing down, the instance group
2872    * arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM
2873    * attributes when making the selection including: + The status of the VM instance. + The health
2874    * of the VM instance. + The instance template version the VM is based on. + For regional managed
2875    * instance groups, the location of the VM instance. This list is subject to change. If the group
2876    * is part of a backend service that has enabled connection draining, it can take up to 60 seconds
2877    * after the connection draining duration has elapsed before the VM instance is removed or
2878    * deleted.
2879    *
2880    * <p>Sample code:
2881    *
2882    * <pre>{@code
2883    * // This snippet has been automatically generated and should be regarded as a code template only.
2884    * // It will require modifications to work:
2885    * // - It may require correct/in-range values for request initialization.
2886    * // - It may require specifying regional endpoints when creating the service client as shown in
2887    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2888    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2889    *     InstanceGroupManagersClient.create()) {
2890    *   String project = "project-309310695";
2891    *   String zone = "zone3744684";
2892    *   String instanceGroupManager = "instanceGroupManager-388242077";
2893    *   int size = 3530753;
2894    *   Operation response =
2895    *       instanceGroupManagersClient.resizeAsync(project, zone, instanceGroupManager, size).get();
2896    * }
2897    * }</pre>
2898    *
2899    * @param project Project ID for this request.
2900    * @param zone The name of the zone where the managed instance group is located.
2901    * @param instanceGroupManager The name of the managed instance group.
2902    * @param size The number of running instances that the managed instance group should maintain at
2903    *     any given time. The group automatically adds or removes instances to maintain the number of
2904    *     instances specified by this parameter.
2905    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2906    */
resizeAsync( String project, String zone, String instanceGroupManager, int size)2907   public final OperationFuture<Operation, Operation> resizeAsync(
2908       String project, String zone, String instanceGroupManager, int size) {
2909     ResizeInstanceGroupManagerRequest request =
2910         ResizeInstanceGroupManagerRequest.newBuilder()
2911             .setProject(project)
2912             .setZone(zone)
2913             .setInstanceGroupManager(instanceGroupManager)
2914             .setSize(size)
2915             .build();
2916     return resizeAsync(request);
2917   }
2918 
2919   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2920   /**
2921    * Resizes the managed instance group. If you increase the size, the group creates new instances
2922    * using the current instance template. If you decrease the size, the group deletes instances. The
2923    * resize operation is marked DONE when the resize actions are scheduled even if the group has not
2924    * yet added or deleted any instances. You must separately verify the status of the creating or
2925    * deleting actions with the listmanagedinstances method. When resizing down, the instance group
2926    * arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM
2927    * attributes when making the selection including: + The status of the VM instance. + The health
2928    * of the VM instance. + The instance template version the VM is based on. + For regional managed
2929    * instance groups, the location of the VM instance. This list is subject to change. If the group
2930    * is part of a backend service that has enabled connection draining, it can take up to 60 seconds
2931    * after the connection draining duration has elapsed before the VM instance is removed or
2932    * deleted.
2933    *
2934    * <p>Sample code:
2935    *
2936    * <pre>{@code
2937    * // This snippet has been automatically generated and should be regarded as a code template only.
2938    * // It will require modifications to work:
2939    * // - It may require correct/in-range values for request initialization.
2940    * // - It may require specifying regional endpoints when creating the service client as shown in
2941    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2942    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2943    *     InstanceGroupManagersClient.create()) {
2944    *   ResizeInstanceGroupManagerRequest request =
2945    *       ResizeInstanceGroupManagerRequest.newBuilder()
2946    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2947    *           .setProject("project-309310695")
2948    *           .setRequestId("requestId693933066")
2949    *           .setSize(3530753)
2950    *           .setZone("zone3744684")
2951    *           .build();
2952    *   Operation response = instanceGroupManagersClient.resizeAsync(request).get();
2953    * }
2954    * }</pre>
2955    *
2956    * @param request The request object containing all of the parameters for the API call.
2957    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
2958    */
2959   @BetaApi(
2960       "The surface for long-running operations is not stable yet and may change in the future.")
resizeAsync( ResizeInstanceGroupManagerRequest request)2961   public final OperationFuture<Operation, Operation> resizeAsync(
2962       ResizeInstanceGroupManagerRequest request) {
2963     return resizeOperationCallable().futureCall(request);
2964   }
2965 
2966   // AUTO-GENERATED DOCUMENTATION AND METHOD.
2967   /**
2968    * Resizes the managed instance group. If you increase the size, the group creates new instances
2969    * using the current instance template. If you decrease the size, the group deletes instances. The
2970    * resize operation is marked DONE when the resize actions are scheduled even if the group has not
2971    * yet added or deleted any instances. You must separately verify the status of the creating or
2972    * deleting actions with the listmanagedinstances method. When resizing down, the instance group
2973    * arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM
2974    * attributes when making the selection including: + The status of the VM instance. + The health
2975    * of the VM instance. + The instance template version the VM is based on. + For regional managed
2976    * instance groups, the location of the VM instance. This list is subject to change. If the group
2977    * is part of a backend service that has enabled connection draining, it can take up to 60 seconds
2978    * after the connection draining duration has elapsed before the VM instance is removed or
2979    * deleted.
2980    *
2981    * <p>Sample code:
2982    *
2983    * <pre>{@code
2984    * // This snippet has been automatically generated and should be regarded as a code template only.
2985    * // It will require modifications to work:
2986    * // - It may require correct/in-range values for request initialization.
2987    * // - It may require specifying regional endpoints when creating the service client as shown in
2988    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
2989    * try (InstanceGroupManagersClient instanceGroupManagersClient =
2990    *     InstanceGroupManagersClient.create()) {
2991    *   ResizeInstanceGroupManagerRequest request =
2992    *       ResizeInstanceGroupManagerRequest.newBuilder()
2993    *           .setInstanceGroupManager("instanceGroupManager-388242077")
2994    *           .setProject("project-309310695")
2995    *           .setRequestId("requestId693933066")
2996    *           .setSize(3530753)
2997    *           .setZone("zone3744684")
2998    *           .build();
2999    *   OperationFuture<Operation, Operation> future =
3000    *       instanceGroupManagersClient.resizeOperationCallable().futureCall(request);
3001    *   // Do something.
3002    *   Operation response = future.get();
3003    * }
3004    * }</pre>
3005    */
3006   public final OperationCallable<ResizeInstanceGroupManagerRequest, Operation, Operation>
resizeOperationCallable()3007       resizeOperationCallable() {
3008     return stub.resizeOperationCallable();
3009   }
3010 
3011   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3012   /**
3013    * Resizes the managed instance group. If you increase the size, the group creates new instances
3014    * using the current instance template. If you decrease the size, the group deletes instances. The
3015    * resize operation is marked DONE when the resize actions are scheduled even if the group has not
3016    * yet added or deleted any instances. You must separately verify the status of the creating or
3017    * deleting actions with the listmanagedinstances method. When resizing down, the instance group
3018    * arbitrarily chooses the order in which VMs are deleted. The group takes into account some VM
3019    * attributes when making the selection including: + The status of the VM instance. + The health
3020    * of the VM instance. + The instance template version the VM is based on. + For regional managed
3021    * instance groups, the location of the VM instance. This list is subject to change. If the group
3022    * is part of a backend service that has enabled connection draining, it can take up to 60 seconds
3023    * after the connection draining duration has elapsed before the VM instance is removed or
3024    * deleted.
3025    *
3026    * <p>Sample code:
3027    *
3028    * <pre>{@code
3029    * // This snippet has been automatically generated and should be regarded as a code template only.
3030    * // It will require modifications to work:
3031    * // - It may require correct/in-range values for request initialization.
3032    * // - It may require specifying regional endpoints when creating the service client as shown in
3033    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3034    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3035    *     InstanceGroupManagersClient.create()) {
3036    *   ResizeInstanceGroupManagerRequest request =
3037    *       ResizeInstanceGroupManagerRequest.newBuilder()
3038    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3039    *           .setProject("project-309310695")
3040    *           .setRequestId("requestId693933066")
3041    *           .setSize(3530753)
3042    *           .setZone("zone3744684")
3043    *           .build();
3044    *   ApiFuture<Operation> future =
3045    *       instanceGroupManagersClient.resizeCallable().futureCall(request);
3046    *   // Do something.
3047    *   Operation response = future.get();
3048    * }
3049    * }</pre>
3050    */
resizeCallable()3051   public final UnaryCallable<ResizeInstanceGroupManagerRequest, Operation> resizeCallable() {
3052     return stub.resizeCallable();
3053   }
3054 
3055   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3056   /**
3057    * Specifies the instance template to use when creating new instances in this group. The templates
3058    * for existing instances in the group do not change unless you run recreateInstances, run
3059    * applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
3060    *
3061    * <p>Sample code:
3062    *
3063    * <pre>{@code
3064    * // This snippet has been automatically generated and should be regarded as a code template only.
3065    * // It will require modifications to work:
3066    * // - It may require correct/in-range values for request initialization.
3067    * // - It may require specifying regional endpoints when creating the service client as shown in
3068    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3069    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3070    *     InstanceGroupManagersClient.create()) {
3071    *   String project = "project-309310695";
3072    *   String zone = "zone3744684";
3073    *   String instanceGroupManager = "instanceGroupManager-388242077";
3074    *   InstanceGroupManagersSetInstanceTemplateRequest
3075    *       instanceGroupManagersSetInstanceTemplateRequestResource =
3076    *           InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build();
3077    *   Operation response =
3078    *       instanceGroupManagersClient
3079    *           .setInstanceTemplateAsync(
3080    *               project,
3081    *               zone,
3082    *               instanceGroupManager,
3083    *               instanceGroupManagersSetInstanceTemplateRequestResource)
3084    *           .get();
3085    * }
3086    * }</pre>
3087    *
3088    * @param project Project ID for this request.
3089    * @param zone The name of the zone where the managed instance group is located.
3090    * @param instanceGroupManager The name of the managed instance group.
3091    * @param instanceGroupManagersSetInstanceTemplateRequestResource The body resource for this
3092    *     request
3093    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3094    */
setInstanceTemplateAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersSetInstanceTemplateRequest instanceGroupManagersSetInstanceTemplateRequestResource)3095   public final OperationFuture<Operation, Operation> setInstanceTemplateAsync(
3096       String project,
3097       String zone,
3098       String instanceGroupManager,
3099       InstanceGroupManagersSetInstanceTemplateRequest
3100           instanceGroupManagersSetInstanceTemplateRequestResource) {
3101     SetInstanceTemplateInstanceGroupManagerRequest request =
3102         SetInstanceTemplateInstanceGroupManagerRequest.newBuilder()
3103             .setProject(project)
3104             .setZone(zone)
3105             .setInstanceGroupManager(instanceGroupManager)
3106             .setInstanceGroupManagersSetInstanceTemplateRequestResource(
3107                 instanceGroupManagersSetInstanceTemplateRequestResource)
3108             .build();
3109     return setInstanceTemplateAsync(request);
3110   }
3111 
3112   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3113   /**
3114    * Specifies the instance template to use when creating new instances in this group. The templates
3115    * for existing instances in the group do not change unless you run recreateInstances, run
3116    * applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
3117    *
3118    * <p>Sample code:
3119    *
3120    * <pre>{@code
3121    * // This snippet has been automatically generated and should be regarded as a code template only.
3122    * // It will require modifications to work:
3123    * // - It may require correct/in-range values for request initialization.
3124    * // - It may require specifying regional endpoints when creating the service client as shown in
3125    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3126    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3127    *     InstanceGroupManagersClient.create()) {
3128    *   SetInstanceTemplateInstanceGroupManagerRequest request =
3129    *       SetInstanceTemplateInstanceGroupManagerRequest.newBuilder()
3130    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3131    *           .setInstanceGroupManagersSetInstanceTemplateRequestResource(
3132    *               InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build())
3133    *           .setProject("project-309310695")
3134    *           .setRequestId("requestId693933066")
3135    *           .setZone("zone3744684")
3136    *           .build();
3137    *   Operation response = instanceGroupManagersClient.setInstanceTemplateAsync(request).get();
3138    * }
3139    * }</pre>
3140    *
3141    * @param request The request object containing all of the parameters for the API call.
3142    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3143    */
3144   @BetaApi(
3145       "The surface for long-running operations is not stable yet and may change in the future.")
setInstanceTemplateAsync( SetInstanceTemplateInstanceGroupManagerRequest request)3146   public final OperationFuture<Operation, Operation> setInstanceTemplateAsync(
3147       SetInstanceTemplateInstanceGroupManagerRequest request) {
3148     return setInstanceTemplateOperationCallable().futureCall(request);
3149   }
3150 
3151   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3152   /**
3153    * Specifies the instance template to use when creating new instances in this group. The templates
3154    * for existing instances in the group do not change unless you run recreateInstances, run
3155    * applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
3156    *
3157    * <p>Sample code:
3158    *
3159    * <pre>{@code
3160    * // This snippet has been automatically generated and should be regarded as a code template only.
3161    * // It will require modifications to work:
3162    * // - It may require correct/in-range values for request initialization.
3163    * // - It may require specifying regional endpoints when creating the service client as shown in
3164    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3165    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3166    *     InstanceGroupManagersClient.create()) {
3167    *   SetInstanceTemplateInstanceGroupManagerRequest request =
3168    *       SetInstanceTemplateInstanceGroupManagerRequest.newBuilder()
3169    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3170    *           .setInstanceGroupManagersSetInstanceTemplateRequestResource(
3171    *               InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build())
3172    *           .setProject("project-309310695")
3173    *           .setRequestId("requestId693933066")
3174    *           .setZone("zone3744684")
3175    *           .build();
3176    *   OperationFuture<Operation, Operation> future =
3177    *       instanceGroupManagersClient.setInstanceTemplateOperationCallable().futureCall(request);
3178    *   // Do something.
3179    *   Operation response = future.get();
3180    * }
3181    * }</pre>
3182    */
3183   public final OperationCallable<
3184           SetInstanceTemplateInstanceGroupManagerRequest, Operation, Operation>
setInstanceTemplateOperationCallable()3185       setInstanceTemplateOperationCallable() {
3186     return stub.setInstanceTemplateOperationCallable();
3187   }
3188 
3189   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3190   /**
3191    * Specifies the instance template to use when creating new instances in this group. The templates
3192    * for existing instances in the group do not change unless you run recreateInstances, run
3193    * applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.
3194    *
3195    * <p>Sample code:
3196    *
3197    * <pre>{@code
3198    * // This snippet has been automatically generated and should be regarded as a code template only.
3199    * // It will require modifications to work:
3200    * // - It may require correct/in-range values for request initialization.
3201    * // - It may require specifying regional endpoints when creating the service client as shown in
3202    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3203    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3204    *     InstanceGroupManagersClient.create()) {
3205    *   SetInstanceTemplateInstanceGroupManagerRequest request =
3206    *       SetInstanceTemplateInstanceGroupManagerRequest.newBuilder()
3207    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3208    *           .setInstanceGroupManagersSetInstanceTemplateRequestResource(
3209    *               InstanceGroupManagersSetInstanceTemplateRequest.newBuilder().build())
3210    *           .setProject("project-309310695")
3211    *           .setRequestId("requestId693933066")
3212    *           .setZone("zone3744684")
3213    *           .build();
3214    *   ApiFuture<Operation> future =
3215    *       instanceGroupManagersClient.setInstanceTemplateCallable().futureCall(request);
3216    *   // Do something.
3217    *   Operation response = future.get();
3218    * }
3219    * }</pre>
3220    */
3221   public final UnaryCallable<SetInstanceTemplateInstanceGroupManagerRequest, Operation>
setInstanceTemplateCallable()3222       setInstanceTemplateCallable() {
3223     return stub.setInstanceTemplateCallable();
3224   }
3225 
3226   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3227   /**
3228    * Modifies the target pools to which all instances in this managed instance group are assigned.
3229    * The target pools automatically apply to all of the instances in the managed instance group.
3230    * This operation is marked DONE when you make the request even if the instances have not yet been
3231    * added to their target pools. The change might take some time to apply to all of the instances
3232    * in the group depending on the size of the group.
3233    *
3234    * <p>Sample code:
3235    *
3236    * <pre>{@code
3237    * // This snippet has been automatically generated and should be regarded as a code template only.
3238    * // It will require modifications to work:
3239    * // - It may require correct/in-range values for request initialization.
3240    * // - It may require specifying regional endpoints when creating the service client as shown in
3241    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3242    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3243    *     InstanceGroupManagersClient.create()) {
3244    *   String project = "project-309310695";
3245    *   String zone = "zone3744684";
3246    *   String instanceGroupManager = "instanceGroupManager-388242077";
3247    *   InstanceGroupManagersSetTargetPoolsRequest
3248    *       instanceGroupManagersSetTargetPoolsRequestResource =
3249    *           InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build();
3250    *   Operation response =
3251    *       instanceGroupManagersClient
3252    *           .setTargetPoolsAsync(
3253    *               project,
3254    *               zone,
3255    *               instanceGroupManager,
3256    *               instanceGroupManagersSetTargetPoolsRequestResource)
3257    *           .get();
3258    * }
3259    * }</pre>
3260    *
3261    * @param project Project ID for this request.
3262    * @param zone The name of the zone where the managed instance group is located.
3263    * @param instanceGroupManager The name of the managed instance group.
3264    * @param instanceGroupManagersSetTargetPoolsRequestResource The body resource for this request
3265    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3266    */
setTargetPoolsAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersSetTargetPoolsRequest instanceGroupManagersSetTargetPoolsRequestResource)3267   public final OperationFuture<Operation, Operation> setTargetPoolsAsync(
3268       String project,
3269       String zone,
3270       String instanceGroupManager,
3271       InstanceGroupManagersSetTargetPoolsRequest
3272           instanceGroupManagersSetTargetPoolsRequestResource) {
3273     SetTargetPoolsInstanceGroupManagerRequest request =
3274         SetTargetPoolsInstanceGroupManagerRequest.newBuilder()
3275             .setProject(project)
3276             .setZone(zone)
3277             .setInstanceGroupManager(instanceGroupManager)
3278             .setInstanceGroupManagersSetTargetPoolsRequestResource(
3279                 instanceGroupManagersSetTargetPoolsRequestResource)
3280             .build();
3281     return setTargetPoolsAsync(request);
3282   }
3283 
3284   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3285   /**
3286    * Modifies the target pools to which all instances in this managed instance group are assigned.
3287    * The target pools automatically apply to all of the instances in the managed instance group.
3288    * This operation is marked DONE when you make the request even if the instances have not yet been
3289    * added to their target pools. The change might take some time to apply to all of the instances
3290    * in the group depending on the size of the group.
3291    *
3292    * <p>Sample code:
3293    *
3294    * <pre>{@code
3295    * // This snippet has been automatically generated and should be regarded as a code template only.
3296    * // It will require modifications to work:
3297    * // - It may require correct/in-range values for request initialization.
3298    * // - It may require specifying regional endpoints when creating the service client as shown in
3299    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3300    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3301    *     InstanceGroupManagersClient.create()) {
3302    *   SetTargetPoolsInstanceGroupManagerRequest request =
3303    *       SetTargetPoolsInstanceGroupManagerRequest.newBuilder()
3304    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3305    *           .setInstanceGroupManagersSetTargetPoolsRequestResource(
3306    *               InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build())
3307    *           .setProject("project-309310695")
3308    *           .setRequestId("requestId693933066")
3309    *           .setZone("zone3744684")
3310    *           .build();
3311    *   Operation response = instanceGroupManagersClient.setTargetPoolsAsync(request).get();
3312    * }
3313    * }</pre>
3314    *
3315    * @param request The request object containing all of the parameters for the API call.
3316    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3317    */
3318   @BetaApi(
3319       "The surface for long-running operations is not stable yet and may change in the future.")
setTargetPoolsAsync( SetTargetPoolsInstanceGroupManagerRequest request)3320   public final OperationFuture<Operation, Operation> setTargetPoolsAsync(
3321       SetTargetPoolsInstanceGroupManagerRequest request) {
3322     return setTargetPoolsOperationCallable().futureCall(request);
3323   }
3324 
3325   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3326   /**
3327    * Modifies the target pools to which all instances in this managed instance group are assigned.
3328    * The target pools automatically apply to all of the instances in the managed instance group.
3329    * This operation is marked DONE when you make the request even if the instances have not yet been
3330    * added to their target pools. The change might take some time to apply to all of the instances
3331    * in the group depending on the size of the group.
3332    *
3333    * <p>Sample code:
3334    *
3335    * <pre>{@code
3336    * // This snippet has been automatically generated and should be regarded as a code template only.
3337    * // It will require modifications to work:
3338    * // - It may require correct/in-range values for request initialization.
3339    * // - It may require specifying regional endpoints when creating the service client as shown in
3340    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3341    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3342    *     InstanceGroupManagersClient.create()) {
3343    *   SetTargetPoolsInstanceGroupManagerRequest request =
3344    *       SetTargetPoolsInstanceGroupManagerRequest.newBuilder()
3345    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3346    *           .setInstanceGroupManagersSetTargetPoolsRequestResource(
3347    *               InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build())
3348    *           .setProject("project-309310695")
3349    *           .setRequestId("requestId693933066")
3350    *           .setZone("zone3744684")
3351    *           .build();
3352    *   OperationFuture<Operation, Operation> future =
3353    *       instanceGroupManagersClient.setTargetPoolsOperationCallable().futureCall(request);
3354    *   // Do something.
3355    *   Operation response = future.get();
3356    * }
3357    * }</pre>
3358    */
3359   public final OperationCallable<SetTargetPoolsInstanceGroupManagerRequest, Operation, Operation>
setTargetPoolsOperationCallable()3360       setTargetPoolsOperationCallable() {
3361     return stub.setTargetPoolsOperationCallable();
3362   }
3363 
3364   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3365   /**
3366    * Modifies the target pools to which all instances in this managed instance group are assigned.
3367    * The target pools automatically apply to all of the instances in the managed instance group.
3368    * This operation is marked DONE when you make the request even if the instances have not yet been
3369    * added to their target pools. The change might take some time to apply to all of the instances
3370    * in the group depending on the size of the group.
3371    *
3372    * <p>Sample code:
3373    *
3374    * <pre>{@code
3375    * // This snippet has been automatically generated and should be regarded as a code template only.
3376    * // It will require modifications to work:
3377    * // - It may require correct/in-range values for request initialization.
3378    * // - It may require specifying regional endpoints when creating the service client as shown in
3379    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3380    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3381    *     InstanceGroupManagersClient.create()) {
3382    *   SetTargetPoolsInstanceGroupManagerRequest request =
3383    *       SetTargetPoolsInstanceGroupManagerRequest.newBuilder()
3384    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3385    *           .setInstanceGroupManagersSetTargetPoolsRequestResource(
3386    *               InstanceGroupManagersSetTargetPoolsRequest.newBuilder().build())
3387    *           .setProject("project-309310695")
3388    *           .setRequestId("requestId693933066")
3389    *           .setZone("zone3744684")
3390    *           .build();
3391    *   ApiFuture<Operation> future =
3392    *       instanceGroupManagersClient.setTargetPoolsCallable().futureCall(request);
3393    *   // Do something.
3394    *   Operation response = future.get();
3395    * }
3396    * }</pre>
3397    */
3398   public final UnaryCallable<SetTargetPoolsInstanceGroupManagerRequest, Operation>
setTargetPoolsCallable()3399       setTargetPoolsCallable() {
3400     return stub.setTargetPoolsCallable();
3401   }
3402 
3403   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3404   /**
3405    * Inserts or updates per-instance configurations for the managed instance group.
3406    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
3407    *
3408    * <p>Sample code:
3409    *
3410    * <pre>{@code
3411    * // This snippet has been automatically generated and should be regarded as a code template only.
3412    * // It will require modifications to work:
3413    * // - It may require correct/in-range values for request initialization.
3414    * // - It may require specifying regional endpoints when creating the service client as shown in
3415    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3416    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3417    *     InstanceGroupManagersClient.create()) {
3418    *   String project = "project-309310695";
3419    *   String zone = "zone3744684";
3420    *   String instanceGroupManager = "instanceGroupManager-388242077";
3421    *   InstanceGroupManagersUpdatePerInstanceConfigsReq
3422    *       instanceGroupManagersUpdatePerInstanceConfigsReqResource =
3423    *           InstanceGroupManagersUpdatePerInstanceConfigsReq.newBuilder().build();
3424    *   Operation response =
3425    *       instanceGroupManagersClient
3426    *           .updatePerInstanceConfigsAsync(
3427    *               project,
3428    *               zone,
3429    *               instanceGroupManager,
3430    *               instanceGroupManagersUpdatePerInstanceConfigsReqResource)
3431    *           .get();
3432    * }
3433    * }</pre>
3434    *
3435    * @param project Project ID for this request.
3436    * @param zone The name of the zone where the managed instance group is located. It should conform
3437    *     to RFC1035.
3438    * @param instanceGroupManager The name of the managed instance group. It should conform to
3439    *     RFC1035.
3440    * @param instanceGroupManagersUpdatePerInstanceConfigsReqResource The body resource for this
3441    *     request
3442    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3443    */
updatePerInstanceConfigsAsync( String project, String zone, String instanceGroupManager, InstanceGroupManagersUpdatePerInstanceConfigsReq instanceGroupManagersUpdatePerInstanceConfigsReqResource)3444   public final OperationFuture<Operation, Operation> updatePerInstanceConfigsAsync(
3445       String project,
3446       String zone,
3447       String instanceGroupManager,
3448       InstanceGroupManagersUpdatePerInstanceConfigsReq
3449           instanceGroupManagersUpdatePerInstanceConfigsReqResource) {
3450     UpdatePerInstanceConfigsInstanceGroupManagerRequest request =
3451         UpdatePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
3452             .setProject(project)
3453             .setZone(zone)
3454             .setInstanceGroupManager(instanceGroupManager)
3455             .setInstanceGroupManagersUpdatePerInstanceConfigsReqResource(
3456                 instanceGroupManagersUpdatePerInstanceConfigsReqResource)
3457             .build();
3458     return updatePerInstanceConfigsAsync(request);
3459   }
3460 
3461   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3462   /**
3463    * Inserts or updates per-instance configurations for the managed instance group.
3464    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
3465    *
3466    * <p>Sample code:
3467    *
3468    * <pre>{@code
3469    * // This snippet has been automatically generated and should be regarded as a code template only.
3470    * // It will require modifications to work:
3471    * // - It may require correct/in-range values for request initialization.
3472    * // - It may require specifying regional endpoints when creating the service client as shown in
3473    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3474    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3475    *     InstanceGroupManagersClient.create()) {
3476    *   UpdatePerInstanceConfigsInstanceGroupManagerRequest request =
3477    *       UpdatePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
3478    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3479    *           .setInstanceGroupManagersUpdatePerInstanceConfigsReqResource(
3480    *               InstanceGroupManagersUpdatePerInstanceConfigsReq.newBuilder().build())
3481    *           .setProject("project-309310695")
3482    *           .setRequestId("requestId693933066")
3483    *           .setZone("zone3744684")
3484    *           .build();
3485    *   Operation response = instanceGroupManagersClient.updatePerInstanceConfigsAsync(request).get();
3486    * }
3487    * }</pre>
3488    *
3489    * @param request The request object containing all of the parameters for the API call.
3490    * @throws com.google.api.gax.rpc.ApiException if the remote call fails
3491    */
3492   @BetaApi(
3493       "The surface for long-running operations is not stable yet and may change in the future.")
updatePerInstanceConfigsAsync( UpdatePerInstanceConfigsInstanceGroupManagerRequest request)3494   public final OperationFuture<Operation, Operation> updatePerInstanceConfigsAsync(
3495       UpdatePerInstanceConfigsInstanceGroupManagerRequest request) {
3496     return updatePerInstanceConfigsOperationCallable().futureCall(request);
3497   }
3498 
3499   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3500   /**
3501    * Inserts or updates per-instance configurations for the managed instance group.
3502    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
3503    *
3504    * <p>Sample code:
3505    *
3506    * <pre>{@code
3507    * // This snippet has been automatically generated and should be regarded as a code template only.
3508    * // It will require modifications to work:
3509    * // - It may require correct/in-range values for request initialization.
3510    * // - It may require specifying regional endpoints when creating the service client as shown in
3511    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3512    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3513    *     InstanceGroupManagersClient.create()) {
3514    *   UpdatePerInstanceConfigsInstanceGroupManagerRequest request =
3515    *       UpdatePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
3516    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3517    *           .setInstanceGroupManagersUpdatePerInstanceConfigsReqResource(
3518    *               InstanceGroupManagersUpdatePerInstanceConfigsReq.newBuilder().build())
3519    *           .setProject("project-309310695")
3520    *           .setRequestId("requestId693933066")
3521    *           .setZone("zone3744684")
3522    *           .build();
3523    *   OperationFuture<Operation, Operation> future =
3524    *       instanceGroupManagersClient
3525    *           .updatePerInstanceConfigsOperationCallable()
3526    *           .futureCall(request);
3527    *   // Do something.
3528    *   Operation response = future.get();
3529    * }
3530    * }</pre>
3531    */
3532   public final OperationCallable<
3533           UpdatePerInstanceConfigsInstanceGroupManagerRequest, Operation, Operation>
updatePerInstanceConfigsOperationCallable()3534       updatePerInstanceConfigsOperationCallable() {
3535     return stub.updatePerInstanceConfigsOperationCallable();
3536   }
3537 
3538   // AUTO-GENERATED DOCUMENTATION AND METHOD.
3539   /**
3540    * Inserts or updates per-instance configurations for the managed instance group.
3541    * perInstanceConfig.name serves as a key used to distinguish whether to perform insert or patch.
3542    *
3543    * <p>Sample code:
3544    *
3545    * <pre>{@code
3546    * // This snippet has been automatically generated and should be regarded as a code template only.
3547    * // It will require modifications to work:
3548    * // - It may require correct/in-range values for request initialization.
3549    * // - It may require specifying regional endpoints when creating the service client as shown in
3550    * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
3551    * try (InstanceGroupManagersClient instanceGroupManagersClient =
3552    *     InstanceGroupManagersClient.create()) {
3553    *   UpdatePerInstanceConfigsInstanceGroupManagerRequest request =
3554    *       UpdatePerInstanceConfigsInstanceGroupManagerRequest.newBuilder()
3555    *           .setInstanceGroupManager("instanceGroupManager-388242077")
3556    *           .setInstanceGroupManagersUpdatePerInstanceConfigsReqResource(
3557    *               InstanceGroupManagersUpdatePerInstanceConfigsReq.newBuilder().build())
3558    *           .setProject("project-309310695")
3559    *           .setRequestId("requestId693933066")
3560    *           .setZone("zone3744684")
3561    *           .build();
3562    *   ApiFuture<Operation> future =
3563    *       instanceGroupManagersClient.updatePerInstanceConfigsCallable().futureCall(request);
3564    *   // Do something.
3565    *   Operation response = future.get();
3566    * }
3567    * }</pre>
3568    */
3569   public final UnaryCallable<UpdatePerInstanceConfigsInstanceGroupManagerRequest, Operation>
updatePerInstanceConfigsCallable()3570       updatePerInstanceConfigsCallable() {
3571     return stub.updatePerInstanceConfigsCallable();
3572   }
3573 
3574   @Override
close()3575   public final void close() {
3576     stub.close();
3577   }
3578 
3579   @Override
shutdown()3580   public void shutdown() {
3581     stub.shutdown();
3582   }
3583 
3584   @Override
isShutdown()3585   public boolean isShutdown() {
3586     return stub.isShutdown();
3587   }
3588 
3589   @Override
isTerminated()3590   public boolean isTerminated() {
3591     return stub.isTerminated();
3592   }
3593 
3594   @Override
shutdownNow()3595   public void shutdownNow() {
3596     stub.shutdownNow();
3597   }
3598 
3599   @Override
awaitTermination(long duration, TimeUnit unit)3600   public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
3601     return stub.awaitTermination(duration, unit);
3602   }
3603 
3604   public static class AggregatedListPagedResponse
3605       extends AbstractPagedListResponse<
3606           AggregatedListInstanceGroupManagersRequest,
3607           InstanceGroupManagerAggregatedList,
3608           Map.Entry<String, InstanceGroupManagersScopedList>,
3609           AggregatedListPage,
3610           AggregatedListFixedSizeCollection> {
3611 
createAsync( PageContext< AggregatedListInstanceGroupManagersRequest, InstanceGroupManagerAggregatedList, Map.Entry<String, InstanceGroupManagersScopedList>> context, ApiFuture<InstanceGroupManagerAggregatedList> futureResponse)3612     public static ApiFuture<AggregatedListPagedResponse> createAsync(
3613         PageContext<
3614                 AggregatedListInstanceGroupManagersRequest,
3615                 InstanceGroupManagerAggregatedList,
3616                 Map.Entry<String, InstanceGroupManagersScopedList>>
3617             context,
3618         ApiFuture<InstanceGroupManagerAggregatedList> futureResponse) {
3619       ApiFuture<AggregatedListPage> futurePage =
3620           AggregatedListPage.createEmptyPage().createPageAsync(context, futureResponse);
3621       return ApiFutures.transform(
3622           futurePage,
3623           input -> new AggregatedListPagedResponse(input),
3624           MoreExecutors.directExecutor());
3625     }
3626 
AggregatedListPagedResponse(AggregatedListPage page)3627     private AggregatedListPagedResponse(AggregatedListPage page) {
3628       super(page, AggregatedListFixedSizeCollection.createEmptyCollection());
3629     }
3630   }
3631 
3632   public static class AggregatedListPage
3633       extends AbstractPage<
3634           AggregatedListInstanceGroupManagersRequest,
3635           InstanceGroupManagerAggregatedList,
3636           Map.Entry<String, InstanceGroupManagersScopedList>,
3637           AggregatedListPage> {
3638 
AggregatedListPage( PageContext< AggregatedListInstanceGroupManagersRequest, InstanceGroupManagerAggregatedList, Map.Entry<String, InstanceGroupManagersScopedList>> context, InstanceGroupManagerAggregatedList response)3639     private AggregatedListPage(
3640         PageContext<
3641                 AggregatedListInstanceGroupManagersRequest,
3642                 InstanceGroupManagerAggregatedList,
3643                 Map.Entry<String, InstanceGroupManagersScopedList>>
3644             context,
3645         InstanceGroupManagerAggregatedList response) {
3646       super(context, response);
3647     }
3648 
createEmptyPage()3649     private static AggregatedListPage createEmptyPage() {
3650       return new AggregatedListPage(null, null);
3651     }
3652 
3653     @Override
createPage( PageContext< AggregatedListInstanceGroupManagersRequest, InstanceGroupManagerAggregatedList, Map.Entry<String, InstanceGroupManagersScopedList>> context, InstanceGroupManagerAggregatedList response)3654     protected AggregatedListPage createPage(
3655         PageContext<
3656                 AggregatedListInstanceGroupManagersRequest,
3657                 InstanceGroupManagerAggregatedList,
3658                 Map.Entry<String, InstanceGroupManagersScopedList>>
3659             context,
3660         InstanceGroupManagerAggregatedList response) {
3661       return new AggregatedListPage(context, response);
3662     }
3663 
3664     @Override
createPageAsync( PageContext< AggregatedListInstanceGroupManagersRequest, InstanceGroupManagerAggregatedList, Map.Entry<String, InstanceGroupManagersScopedList>> context, ApiFuture<InstanceGroupManagerAggregatedList> futureResponse)3665     public ApiFuture<AggregatedListPage> createPageAsync(
3666         PageContext<
3667                 AggregatedListInstanceGroupManagersRequest,
3668                 InstanceGroupManagerAggregatedList,
3669                 Map.Entry<String, InstanceGroupManagersScopedList>>
3670             context,
3671         ApiFuture<InstanceGroupManagerAggregatedList> futureResponse) {
3672       return super.createPageAsync(context, futureResponse);
3673     }
3674   }
3675 
3676   public static class AggregatedListFixedSizeCollection
3677       extends AbstractFixedSizeCollection<
3678           AggregatedListInstanceGroupManagersRequest,
3679           InstanceGroupManagerAggregatedList,
3680           Map.Entry<String, InstanceGroupManagersScopedList>,
3681           AggregatedListPage,
3682           AggregatedListFixedSizeCollection> {
3683 
AggregatedListFixedSizeCollection(List<AggregatedListPage> pages, int collectionSize)3684     private AggregatedListFixedSizeCollection(List<AggregatedListPage> pages, int collectionSize) {
3685       super(pages, collectionSize);
3686     }
3687 
createEmptyCollection()3688     private static AggregatedListFixedSizeCollection createEmptyCollection() {
3689       return new AggregatedListFixedSizeCollection(null, 0);
3690     }
3691 
3692     @Override
createCollection( List<AggregatedListPage> pages, int collectionSize)3693     protected AggregatedListFixedSizeCollection createCollection(
3694         List<AggregatedListPage> pages, int collectionSize) {
3695       return new AggregatedListFixedSizeCollection(pages, collectionSize);
3696     }
3697   }
3698 
3699   public static class ListPagedResponse
3700       extends AbstractPagedListResponse<
3701           ListInstanceGroupManagersRequest,
3702           InstanceGroupManagerList,
3703           InstanceGroupManager,
3704           ListPage,
3705           ListFixedSizeCollection> {
3706 
createAsync( PageContext< ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager> context, ApiFuture<InstanceGroupManagerList> futureResponse)3707     public static ApiFuture<ListPagedResponse> createAsync(
3708         PageContext<
3709                 ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager>
3710             context,
3711         ApiFuture<InstanceGroupManagerList> futureResponse) {
3712       ApiFuture<ListPage> futurePage =
3713           ListPage.createEmptyPage().createPageAsync(context, futureResponse);
3714       return ApiFutures.transform(
3715           futurePage, input -> new ListPagedResponse(input), MoreExecutors.directExecutor());
3716     }
3717 
ListPagedResponse(ListPage page)3718     private ListPagedResponse(ListPage page) {
3719       super(page, ListFixedSizeCollection.createEmptyCollection());
3720     }
3721   }
3722 
3723   public static class ListPage
3724       extends AbstractPage<
3725           ListInstanceGroupManagersRequest,
3726           InstanceGroupManagerList,
3727           InstanceGroupManager,
3728           ListPage> {
3729 
ListPage( PageContext< ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager> context, InstanceGroupManagerList response)3730     private ListPage(
3731         PageContext<
3732                 ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager>
3733             context,
3734         InstanceGroupManagerList response) {
3735       super(context, response);
3736     }
3737 
createEmptyPage()3738     private static ListPage createEmptyPage() {
3739       return new ListPage(null, null);
3740     }
3741 
3742     @Override
createPage( PageContext< ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager> context, InstanceGroupManagerList response)3743     protected ListPage createPage(
3744         PageContext<
3745                 ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager>
3746             context,
3747         InstanceGroupManagerList response) {
3748       return new ListPage(context, response);
3749     }
3750 
3751     @Override
createPageAsync( PageContext< ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager> context, ApiFuture<InstanceGroupManagerList> futureResponse)3752     public ApiFuture<ListPage> createPageAsync(
3753         PageContext<
3754                 ListInstanceGroupManagersRequest, InstanceGroupManagerList, InstanceGroupManager>
3755             context,
3756         ApiFuture<InstanceGroupManagerList> futureResponse) {
3757       return super.createPageAsync(context, futureResponse);
3758     }
3759   }
3760 
3761   public static class ListFixedSizeCollection
3762       extends AbstractFixedSizeCollection<
3763           ListInstanceGroupManagersRequest,
3764           InstanceGroupManagerList,
3765           InstanceGroupManager,
3766           ListPage,
3767           ListFixedSizeCollection> {
3768 
ListFixedSizeCollection(List<ListPage> pages, int collectionSize)3769     private ListFixedSizeCollection(List<ListPage> pages, int collectionSize) {
3770       super(pages, collectionSize);
3771     }
3772 
createEmptyCollection()3773     private static ListFixedSizeCollection createEmptyCollection() {
3774       return new ListFixedSizeCollection(null, 0);
3775     }
3776 
3777     @Override
createCollection(List<ListPage> pages, int collectionSize)3778     protected ListFixedSizeCollection createCollection(List<ListPage> pages, int collectionSize) {
3779       return new ListFixedSizeCollection(pages, collectionSize);
3780     }
3781   }
3782 
3783   public static class ListErrorsPagedResponse
3784       extends AbstractPagedListResponse<
3785           ListErrorsInstanceGroupManagersRequest,
3786           InstanceGroupManagersListErrorsResponse,
3787           InstanceManagedByIgmError,
3788           ListErrorsPage,
3789           ListErrorsFixedSizeCollection> {
3790 
createAsync( PageContext< ListErrorsInstanceGroupManagersRequest, InstanceGroupManagersListErrorsResponse, InstanceManagedByIgmError> context, ApiFuture<InstanceGroupManagersListErrorsResponse> futureResponse)3791     public static ApiFuture<ListErrorsPagedResponse> createAsync(
3792         PageContext<
3793                 ListErrorsInstanceGroupManagersRequest,
3794                 InstanceGroupManagersListErrorsResponse,
3795                 InstanceManagedByIgmError>
3796             context,
3797         ApiFuture<InstanceGroupManagersListErrorsResponse> futureResponse) {
3798       ApiFuture<ListErrorsPage> futurePage =
3799           ListErrorsPage.createEmptyPage().createPageAsync(context, futureResponse);
3800       return ApiFutures.transform(
3801           futurePage, input -> new ListErrorsPagedResponse(input), MoreExecutors.directExecutor());
3802     }
3803 
ListErrorsPagedResponse(ListErrorsPage page)3804     private ListErrorsPagedResponse(ListErrorsPage page) {
3805       super(page, ListErrorsFixedSizeCollection.createEmptyCollection());
3806     }
3807   }
3808 
3809   public static class ListErrorsPage
3810       extends AbstractPage<
3811           ListErrorsInstanceGroupManagersRequest,
3812           InstanceGroupManagersListErrorsResponse,
3813           InstanceManagedByIgmError,
3814           ListErrorsPage> {
3815 
ListErrorsPage( PageContext< ListErrorsInstanceGroupManagersRequest, InstanceGroupManagersListErrorsResponse, InstanceManagedByIgmError> context, InstanceGroupManagersListErrorsResponse response)3816     private ListErrorsPage(
3817         PageContext<
3818                 ListErrorsInstanceGroupManagersRequest,
3819                 InstanceGroupManagersListErrorsResponse,
3820                 InstanceManagedByIgmError>
3821             context,
3822         InstanceGroupManagersListErrorsResponse response) {
3823       super(context, response);
3824     }
3825 
createEmptyPage()3826     private static ListErrorsPage createEmptyPage() {
3827       return new ListErrorsPage(null, null);
3828     }
3829 
3830     @Override
createPage( PageContext< ListErrorsInstanceGroupManagersRequest, InstanceGroupManagersListErrorsResponse, InstanceManagedByIgmError> context, InstanceGroupManagersListErrorsResponse response)3831     protected ListErrorsPage createPage(
3832         PageContext<
3833                 ListErrorsInstanceGroupManagersRequest,
3834                 InstanceGroupManagersListErrorsResponse,
3835                 InstanceManagedByIgmError>
3836             context,
3837         InstanceGroupManagersListErrorsResponse response) {
3838       return new ListErrorsPage(context, response);
3839     }
3840 
3841     @Override
createPageAsync( PageContext< ListErrorsInstanceGroupManagersRequest, InstanceGroupManagersListErrorsResponse, InstanceManagedByIgmError> context, ApiFuture<InstanceGroupManagersListErrorsResponse> futureResponse)3842     public ApiFuture<ListErrorsPage> createPageAsync(
3843         PageContext<
3844                 ListErrorsInstanceGroupManagersRequest,
3845                 InstanceGroupManagersListErrorsResponse,
3846                 InstanceManagedByIgmError>
3847             context,
3848         ApiFuture<InstanceGroupManagersListErrorsResponse> futureResponse) {
3849       return super.createPageAsync(context, futureResponse);
3850     }
3851   }
3852 
3853   public static class ListErrorsFixedSizeCollection
3854       extends AbstractFixedSizeCollection<
3855           ListErrorsInstanceGroupManagersRequest,
3856           InstanceGroupManagersListErrorsResponse,
3857           InstanceManagedByIgmError,
3858           ListErrorsPage,
3859           ListErrorsFixedSizeCollection> {
3860 
ListErrorsFixedSizeCollection(List<ListErrorsPage> pages, int collectionSize)3861     private ListErrorsFixedSizeCollection(List<ListErrorsPage> pages, int collectionSize) {
3862       super(pages, collectionSize);
3863     }
3864 
createEmptyCollection()3865     private static ListErrorsFixedSizeCollection createEmptyCollection() {
3866       return new ListErrorsFixedSizeCollection(null, 0);
3867     }
3868 
3869     @Override
createCollection( List<ListErrorsPage> pages, int collectionSize)3870     protected ListErrorsFixedSizeCollection createCollection(
3871         List<ListErrorsPage> pages, int collectionSize) {
3872       return new ListErrorsFixedSizeCollection(pages, collectionSize);
3873     }
3874   }
3875 
3876   public static class ListManagedInstancesPagedResponse
3877       extends AbstractPagedListResponse<
3878           ListManagedInstancesInstanceGroupManagersRequest,
3879           InstanceGroupManagersListManagedInstancesResponse,
3880           ManagedInstance,
3881           ListManagedInstancesPage,
3882           ListManagedInstancesFixedSizeCollection> {
3883 
createAsync( PageContext< ListManagedInstancesInstanceGroupManagersRequest, InstanceGroupManagersListManagedInstancesResponse, ManagedInstance> context, ApiFuture<InstanceGroupManagersListManagedInstancesResponse> futureResponse)3884     public static ApiFuture<ListManagedInstancesPagedResponse> createAsync(
3885         PageContext<
3886                 ListManagedInstancesInstanceGroupManagersRequest,
3887                 InstanceGroupManagersListManagedInstancesResponse,
3888                 ManagedInstance>
3889             context,
3890         ApiFuture<InstanceGroupManagersListManagedInstancesResponse> futureResponse) {
3891       ApiFuture<ListManagedInstancesPage> futurePage =
3892           ListManagedInstancesPage.createEmptyPage().createPageAsync(context, futureResponse);
3893       return ApiFutures.transform(
3894           futurePage,
3895           input -> new ListManagedInstancesPagedResponse(input),
3896           MoreExecutors.directExecutor());
3897     }
3898 
ListManagedInstancesPagedResponse(ListManagedInstancesPage page)3899     private ListManagedInstancesPagedResponse(ListManagedInstancesPage page) {
3900       super(page, ListManagedInstancesFixedSizeCollection.createEmptyCollection());
3901     }
3902   }
3903 
3904   public static class ListManagedInstancesPage
3905       extends AbstractPage<
3906           ListManagedInstancesInstanceGroupManagersRequest,
3907           InstanceGroupManagersListManagedInstancesResponse,
3908           ManagedInstance,
3909           ListManagedInstancesPage> {
3910 
ListManagedInstancesPage( PageContext< ListManagedInstancesInstanceGroupManagersRequest, InstanceGroupManagersListManagedInstancesResponse, ManagedInstance> context, InstanceGroupManagersListManagedInstancesResponse response)3911     private ListManagedInstancesPage(
3912         PageContext<
3913                 ListManagedInstancesInstanceGroupManagersRequest,
3914                 InstanceGroupManagersListManagedInstancesResponse,
3915                 ManagedInstance>
3916             context,
3917         InstanceGroupManagersListManagedInstancesResponse response) {
3918       super(context, response);
3919     }
3920 
createEmptyPage()3921     private static ListManagedInstancesPage createEmptyPage() {
3922       return new ListManagedInstancesPage(null, null);
3923     }
3924 
3925     @Override
createPage( PageContext< ListManagedInstancesInstanceGroupManagersRequest, InstanceGroupManagersListManagedInstancesResponse, ManagedInstance> context, InstanceGroupManagersListManagedInstancesResponse response)3926     protected ListManagedInstancesPage createPage(
3927         PageContext<
3928                 ListManagedInstancesInstanceGroupManagersRequest,
3929                 InstanceGroupManagersListManagedInstancesResponse,
3930                 ManagedInstance>
3931             context,
3932         InstanceGroupManagersListManagedInstancesResponse response) {
3933       return new ListManagedInstancesPage(context, response);
3934     }
3935 
3936     @Override
createPageAsync( PageContext< ListManagedInstancesInstanceGroupManagersRequest, InstanceGroupManagersListManagedInstancesResponse, ManagedInstance> context, ApiFuture<InstanceGroupManagersListManagedInstancesResponse> futureResponse)3937     public ApiFuture<ListManagedInstancesPage> createPageAsync(
3938         PageContext<
3939                 ListManagedInstancesInstanceGroupManagersRequest,
3940                 InstanceGroupManagersListManagedInstancesResponse,
3941                 ManagedInstance>
3942             context,
3943         ApiFuture<InstanceGroupManagersListManagedInstancesResponse> futureResponse) {
3944       return super.createPageAsync(context, futureResponse);
3945     }
3946   }
3947 
3948   public static class ListManagedInstancesFixedSizeCollection
3949       extends AbstractFixedSizeCollection<
3950           ListManagedInstancesInstanceGroupManagersRequest,
3951           InstanceGroupManagersListManagedInstancesResponse,
3952           ManagedInstance,
3953           ListManagedInstancesPage,
3954           ListManagedInstancesFixedSizeCollection> {
3955 
ListManagedInstancesFixedSizeCollection( List<ListManagedInstancesPage> pages, int collectionSize)3956     private ListManagedInstancesFixedSizeCollection(
3957         List<ListManagedInstancesPage> pages, int collectionSize) {
3958       super(pages, collectionSize);
3959     }
3960 
createEmptyCollection()3961     private static ListManagedInstancesFixedSizeCollection createEmptyCollection() {
3962       return new ListManagedInstancesFixedSizeCollection(null, 0);
3963     }
3964 
3965     @Override
createCollection( List<ListManagedInstancesPage> pages, int collectionSize)3966     protected ListManagedInstancesFixedSizeCollection createCollection(
3967         List<ListManagedInstancesPage> pages, int collectionSize) {
3968       return new ListManagedInstancesFixedSizeCollection(pages, collectionSize);
3969     }
3970   }
3971 
3972   public static class ListPerInstanceConfigsPagedResponse
3973       extends AbstractPagedListResponse<
3974           ListPerInstanceConfigsInstanceGroupManagersRequest,
3975           InstanceGroupManagersListPerInstanceConfigsResp,
3976           PerInstanceConfig,
3977           ListPerInstanceConfigsPage,
3978           ListPerInstanceConfigsFixedSizeCollection> {
3979 
createAsync( PageContext< ListPerInstanceConfigsInstanceGroupManagersRequest, InstanceGroupManagersListPerInstanceConfigsResp, PerInstanceConfig> context, ApiFuture<InstanceGroupManagersListPerInstanceConfigsResp> futureResponse)3980     public static ApiFuture<ListPerInstanceConfigsPagedResponse> createAsync(
3981         PageContext<
3982                 ListPerInstanceConfigsInstanceGroupManagersRequest,
3983                 InstanceGroupManagersListPerInstanceConfigsResp,
3984                 PerInstanceConfig>
3985             context,
3986         ApiFuture<InstanceGroupManagersListPerInstanceConfigsResp> futureResponse) {
3987       ApiFuture<ListPerInstanceConfigsPage> futurePage =
3988           ListPerInstanceConfigsPage.createEmptyPage().createPageAsync(context, futureResponse);
3989       return ApiFutures.transform(
3990           futurePage,
3991           input -> new ListPerInstanceConfigsPagedResponse(input),
3992           MoreExecutors.directExecutor());
3993     }
3994 
ListPerInstanceConfigsPagedResponse(ListPerInstanceConfigsPage page)3995     private ListPerInstanceConfigsPagedResponse(ListPerInstanceConfigsPage page) {
3996       super(page, ListPerInstanceConfigsFixedSizeCollection.createEmptyCollection());
3997     }
3998   }
3999 
4000   public static class ListPerInstanceConfigsPage
4001       extends AbstractPage<
4002           ListPerInstanceConfigsInstanceGroupManagersRequest,
4003           InstanceGroupManagersListPerInstanceConfigsResp,
4004           PerInstanceConfig,
4005           ListPerInstanceConfigsPage> {
4006 
ListPerInstanceConfigsPage( PageContext< ListPerInstanceConfigsInstanceGroupManagersRequest, InstanceGroupManagersListPerInstanceConfigsResp, PerInstanceConfig> context, InstanceGroupManagersListPerInstanceConfigsResp response)4007     private ListPerInstanceConfigsPage(
4008         PageContext<
4009                 ListPerInstanceConfigsInstanceGroupManagersRequest,
4010                 InstanceGroupManagersListPerInstanceConfigsResp,
4011                 PerInstanceConfig>
4012             context,
4013         InstanceGroupManagersListPerInstanceConfigsResp response) {
4014       super(context, response);
4015     }
4016 
createEmptyPage()4017     private static ListPerInstanceConfigsPage createEmptyPage() {
4018       return new ListPerInstanceConfigsPage(null, null);
4019     }
4020 
4021     @Override
createPage( PageContext< ListPerInstanceConfigsInstanceGroupManagersRequest, InstanceGroupManagersListPerInstanceConfigsResp, PerInstanceConfig> context, InstanceGroupManagersListPerInstanceConfigsResp response)4022     protected ListPerInstanceConfigsPage createPage(
4023         PageContext<
4024                 ListPerInstanceConfigsInstanceGroupManagersRequest,
4025                 InstanceGroupManagersListPerInstanceConfigsResp,
4026                 PerInstanceConfig>
4027             context,
4028         InstanceGroupManagersListPerInstanceConfigsResp response) {
4029       return new ListPerInstanceConfigsPage(context, response);
4030     }
4031 
4032     @Override
createPageAsync( PageContext< ListPerInstanceConfigsInstanceGroupManagersRequest, InstanceGroupManagersListPerInstanceConfigsResp, PerInstanceConfig> context, ApiFuture<InstanceGroupManagersListPerInstanceConfigsResp> futureResponse)4033     public ApiFuture<ListPerInstanceConfigsPage> createPageAsync(
4034         PageContext<
4035                 ListPerInstanceConfigsInstanceGroupManagersRequest,
4036                 InstanceGroupManagersListPerInstanceConfigsResp,
4037                 PerInstanceConfig>
4038             context,
4039         ApiFuture<InstanceGroupManagersListPerInstanceConfigsResp> futureResponse) {
4040       return super.createPageAsync(context, futureResponse);
4041     }
4042   }
4043 
4044   public static class ListPerInstanceConfigsFixedSizeCollection
4045       extends AbstractFixedSizeCollection<
4046           ListPerInstanceConfigsInstanceGroupManagersRequest,
4047           InstanceGroupManagersListPerInstanceConfigsResp,
4048           PerInstanceConfig,
4049           ListPerInstanceConfigsPage,
4050           ListPerInstanceConfigsFixedSizeCollection> {
4051 
ListPerInstanceConfigsFixedSizeCollection( List<ListPerInstanceConfigsPage> pages, int collectionSize)4052     private ListPerInstanceConfigsFixedSizeCollection(
4053         List<ListPerInstanceConfigsPage> pages, int collectionSize) {
4054       super(pages, collectionSize);
4055     }
4056 
createEmptyCollection()4057     private static ListPerInstanceConfigsFixedSizeCollection createEmptyCollection() {
4058       return new ListPerInstanceConfigsFixedSizeCollection(null, 0);
4059     }
4060 
4061     @Override
createCollection( List<ListPerInstanceConfigsPage> pages, int collectionSize)4062     protected ListPerInstanceConfigsFixedSizeCollection createCollection(
4063         List<ListPerInstanceConfigsPage> pages, int collectionSize) {
4064       return new ListPerInstanceConfigsFixedSizeCollection(pages, collectionSize);
4065     }
4066   }
4067 }
4068