@BetaApi
  public final Operation resizeRegionInstanceGroupManager(
      Integer size, ProjectRegionInstanceGroupManagerName instanceGroupManager) {

    ResizeRegionInstanceGroupManagerHttpRequest request =
        ResizeRegionInstanceGroupManagerHttpRequest.newBuilder()
            .setSize(size)
            .setInstanceGroupManager(
                instanceGroupManager == null ? null : instanceGroupManager.toString())
            .build();
    return resizeRegionInstanceGroupManager(request);
  }
@ BetaApi public final Operation resizeRegionInstanceGroupManager ( Integer size , ProjectRegionInstanceGroupManagerName instanceGroupManager ) { ResizeRegionInstanceGroupManagerHttpRequest request = ResizeRegionInstanceGroupManagerHttpRequest . newBuilder ( ) . setSize ( size ) . setInstanceGroupManager ( instanceGroupManager == null ? null : instanceGroupManager . toString ( ) ) . build ( ) ; return resizeRegionInstanceGroupManager ( request ) ; }
Changes the intended size of the managed instance group. If you increase the size, the group
creates new instances using the current instance template. If you decrease the size, the group
deletes one or more instances.

<p>The resize operation is marked DONE if the resize request is successful. The underlying
actions take additional time. You must separately verify the status of the creating or deleting
actions with the listmanagedinstances method.

<p>If the group is part of a backend service that has enabled connection draining, it can take
up to 60 seconds after the connection draining duration has elapsed before the VM instance is
removed or deleted.

<p>Sample code:

<pre><code>
try (RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient.create()) {
Integer size = 0;
ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName.of("[PROJECT]", "[REGION]", "[INSTANCE_GROUP_MANAGER]");
Operation response = regionInstanceGroupManagerClient.resizeRegionInstanceGroupManager(size, instanceGroupManager);
}
</code></pre>

@param size Number of instances that should exist in this instance group manager.
@param instanceGroupManager Name of the managed instance group.
@throws com.google.api.gax.rpc.ApiException if the remote call fails