@BetaApi
  public final Operation setDiskAutoDeleteInstance(
      ProjectZoneInstanceName instance, Boolean autoDelete, String deviceName) {

    SetDiskAutoDeleteInstanceHttpRequest request =
        SetDiskAutoDeleteInstanceHttpRequest.newBuilder()
            .setInstance(instance == null ? null : instance.toString())
            .setAutoDelete(autoDelete)
            .setDeviceName(deviceName)
            .build();
    return setDiskAutoDeleteInstance(request);
  }
@ BetaApi public final Operation setDiskAutoDeleteInstance ( ProjectZoneInstanceName instance , Boolean autoDelete , String deviceName ) { SetDiskAutoDeleteInstanceHttpRequest request = SetDiskAutoDeleteInstanceHttpRequest . newBuilder ( ) . setInstance ( instance == null ? null : instance . toString ( ) ) . setAutoDelete ( autoDelete ) . setDeviceName ( deviceName ) . build ( ) ; return setDiskAutoDeleteInstance ( request ) ; }
Sets the auto-delete flag for a disk attached to an instance.

<p>Sample code:

<pre><code>
try (InstanceClient instanceClient = InstanceClient.create()) {
ProjectZoneInstanceName instance = ProjectZoneInstanceName.of("[PROJECT]", "[ZONE]", "[INSTANCE]");
Boolean autoDelete = false;
String deviceName = "";
Operation response = instanceClient.setDiskAutoDeleteInstance(instance, autoDelete, deviceName);
}
</code></pre>

@param instance The instance name for this request.
@param autoDelete Whether to auto-delete the disk when the instance is deleted.
@param deviceName The device name of the disk to modify. Make a get() request on the instance
to view currently attached disks and device names.
@throws com.google.api.gax.rpc.ApiException if the remote call fails