com.amazonaws.services.storagegateway.model.DetachVolumeRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-storagegateway Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.storagegateway.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* AttachVolumeInput
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DetachVolumeRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the volume to detach from the gateway.
*
*/
private String volumeARN;
/**
*
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the volume. The
* default is false
. If this value is set to false
, you must manually disconnect the iSCSI
* connection from the target volume.
*
*
* Valid Values: true
| false
*
*/
private Boolean forceDetach;
/**
*
* The Amazon Resource Name (ARN) of the volume to detach from the gateway.
*
*
* @param volumeARN
* The Amazon Resource Name (ARN) of the volume to detach from the gateway.
*/
public void setVolumeARN(String volumeARN) {
this.volumeARN = volumeARN;
}
/**
*
* The Amazon Resource Name (ARN) of the volume to detach from the gateway.
*
*
* @return The Amazon Resource Name (ARN) of the volume to detach from the gateway.
*/
public String getVolumeARN() {
return this.volumeARN;
}
/**
*
* The Amazon Resource Name (ARN) of the volume to detach from the gateway.
*
*
* @param volumeARN
* The Amazon Resource Name (ARN) of the volume to detach from the gateway.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DetachVolumeRequest withVolumeARN(String volumeARN) {
setVolumeARN(volumeARN);
return this;
}
/**
*
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the volume. The
* default is false
. If this value is set to false
, you must manually disconnect the iSCSI
* connection from the target volume.
*
*
* Valid Values: true
| false
*
*
* @param forceDetach
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the
* volume. The default is false
. If this value is set to false
, you must manually
* disconnect the iSCSI connection from the target volume.
*
* Valid Values: true
| false
*/
public void setForceDetach(Boolean forceDetach) {
this.forceDetach = forceDetach;
}
/**
*
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the volume. The
* default is false
. If this value is set to false
, you must manually disconnect the iSCSI
* connection from the target volume.
*
*
* Valid Values: true
| false
*
*
* @return Set to true
to forcibly remove the iSCSI connection of the target volume and detach the
* volume. The default is false
. If this value is set to false
, you must manually
* disconnect the iSCSI connection from the target volume.
*
* Valid Values: true
| false
*/
public Boolean getForceDetach() {
return this.forceDetach;
}
/**
*
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the volume. The
* default is false
. If this value is set to false
, you must manually disconnect the iSCSI
* connection from the target volume.
*
*
* Valid Values: true
| false
*
*
* @param forceDetach
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the
* volume. The default is false
. If this value is set to false
, you must manually
* disconnect the iSCSI connection from the target volume.
*
* Valid Values: true
| false
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DetachVolumeRequest withForceDetach(Boolean forceDetach) {
setForceDetach(forceDetach);
return this;
}
/**
*
* Set to true
to forcibly remove the iSCSI connection of the target volume and detach the volume. The
* default is false
. If this value is set to false
, you must manually disconnect the iSCSI
* connection from the target volume.
*
*
* Valid Values: true
| false
*
*
* @return Set to true
to forcibly remove the iSCSI connection of the target volume and detach the
* volume. The default is false
. If this value is set to false
, you must manually
* disconnect the iSCSI connection from the target volume.
*
* Valid Values: true
| false
*/
public Boolean isForceDetach() {
return this.forceDetach;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getVolumeARN() != null)
sb.append("VolumeARN: ").append(getVolumeARN()).append(",");
if (getForceDetach() != null)
sb.append("ForceDetach: ").append(getForceDetach());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DetachVolumeRequest == false)
return false;
DetachVolumeRequest other = (DetachVolumeRequest) obj;
if (other.getVolumeARN() == null ^ this.getVolumeARN() == null)
return false;
if (other.getVolumeARN() != null && other.getVolumeARN().equals(this.getVolumeARN()) == false)
return false;
if (other.getForceDetach() == null ^ this.getForceDetach() == null)
return false;
if (other.getForceDetach() != null && other.getForceDetach().equals(this.getForceDetach()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getVolumeARN() == null) ? 0 : getVolumeARN().hashCode());
hashCode = prime * hashCode + ((getForceDetach() == null) ? 0 : getForceDetach().hashCode());
return hashCode;
}
@Override
public DetachVolumeRequest clone() {
return (DetachVolumeRequest) super.clone();
}
}