/** * Constructs a new DetachVolumeRequest object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param volumeId * The ID of the volume. */ public DetachVolumeRequest(String volumeId) { setVolumeId(volumeId); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDevice() == null) ? 0 : getDevice().hashCode()); hashCode = prime * hashCode + ((getForce() == null) ? 0 : getForce().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getVolumeId() == null) ? 0 : getVolumeId().hashCode()); return hashCode; }
/** * <p> * The device name. * </p> * * @param device * The device name. * @return Returns a reference to this object so that method calls can be chained together. */ public DetachVolumeRequest withDevice(String device) { setDevice(device); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getVolumeId() == null) ? 0 : getVolumeId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getDevice() == null) ? 0 : getDevice().hashCode()); hashCode = prime * hashCode + ((isForce() == null) ? 0 : isForce().hashCode()); return hashCode; }
@Override public String detachVolume(VolumeRequest request) { com.amazonaws.services.ec2.model.DetachVolumeRequest dvr = new com.amazonaws.services.ec2.model.DetachVolumeRequest(); dvr.setInstanceId(request.getInstanceId()); dvr.setVolumeId(request.getVolumeId()); dvr.setDevice(request.getDevice()); client.detachVolume(dvr); return waitForDetached(request.getVolumeId(), request.getTimeout()); }
/** * * @param volumeId * @param instanceId * @param device * @param force * @param ec2Client */ public void detachEbsVolumeFromInstance(String volumeId, String instanceId, String device, boolean force, AmazonEC2 ec2Client) { DetachVolumeRequest request = new DetachVolumeRequest() .withDevice(device) .withInstanceId(instanceId) .withVolumeId(volumeId) .withForce(force); @SuppressWarnings("unused") DetachVolumeResult result = ec2Client.detachVolume(request); }
@Override public DetachVolumeResult detachFromInstance( ResultCapture<DetachVolumeResult> extractor) { DetachVolumeRequest request = new DetachVolumeRequest(); return detachFromInstance(request, extractor); }
/** * <p> * The ID of the instance. * </p> * * @param instanceId * The ID of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public DetachVolumeRequest withInstanceId(String instanceId) { setInstanceId(instanceId); return this; }
@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.getVolumeId() == null ^ this.getVolumeId() == null) return false; if (other.getVolumeId() != null && other.getVolumeId().equals(this.getVolumeId()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getDevice() == null ^ this.getDevice() == null) return false; if (other.getDevice() != null && other.getDevice().equals(this.getDevice()) == false) return false; if (other.isForce() == null ^ this.isForce() == null) return false; if (other.isForce() != null && other.isForce().equals(this.isForce()) == false) return false; return true; }
@Override public DetachVolumeResult detachFromInstance( ResultCapture<DetachVolumeResult> extractor) { DetachVolumeRequest request = new DetachVolumeRequest(); return detachFromInstance(request, extractor); }
/** * <p> * The ID of the instance. * </p> * * @param instanceId * The ID of the instance. * @return Returns a reference to this object so that method calls can be chained together. */ public DetachVolumeRequest withInstanceId(String instanceId) { setInstanceId(instanceId); return this; }
@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.getDevice() == null ^ this.getDevice() == null) return false; if (other.getDevice() != null && other.getDevice().equals(this.getDevice()) == false) return false; if (other.getForce() == null ^ this.getForce() == null) return false; if (other.getForce() != null && other.getForce().equals(this.getForce()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null) return false; if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getVolumeId() == null ^ this.getVolumeId() == null) return false; if (other.getVolumeId() != null && other.getVolumeId().equals(this.getVolumeId()) == false) return false; return true; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getVolumeId() != null) sb.append("VolumeId: " + getVolumeId() + ","); if (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ","); if (getDevice() != null) sb.append("Device: " + getDevice() + ","); if (isForce() != null) sb.append("Force: " + isForce() ); sb.append("}"); return sb.toString(); }
/** * <p> * The ID of the volume. * </p> * * @param volumeId * The ID of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public DetachVolumeRequest withVolumeId(String volumeId) { setVolumeId(volumeId); return this; }
/** * <p> * The device name. * </p> * * @param device * The device name. * @return Returns a reference to this object so that method calls can be chained together. */ public DetachVolumeRequest withDevice(String device) { setDevice(device); return this; }
/** * 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 (getDevice() != null) sb.append("Device: ").append(getDevice()).append(","); if (getForce() != null) sb.append("Force: ").append(getForce()).append(","); if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getVolumeId() != null) sb.append("VolumeId: ").append(getVolumeId()); sb.append("}"); return sb.toString(); }
public Request<DetachVolumeRequest> marshall(DetachVolumeRequest detachVolumeRequest) { if (detachVolumeRequest == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } Request<DetachVolumeRequest> request = new DefaultRequest<DetachVolumeRequest>(detachVolumeRequest, "AmazonEC2"); request.addParameter("Action", "DetachVolume"); request.addParameter("Version", "2015-10-01"); if (detachVolumeRequest.getVolumeId() != null) { request.addParameter("VolumeId", StringUtils.fromString(detachVolumeRequest.getVolumeId())); } if (detachVolumeRequest.getInstanceId() != null) { request.addParameter("InstanceId", StringUtils.fromString(detachVolumeRequest.getInstanceId())); } if (detachVolumeRequest.getDevice() != null) { request.addParameter("Device", StringUtils.fromString(detachVolumeRequest.getDevice())); } if (detachVolumeRequest.isForce() != null) { request.addParameter("Force", StringUtils.fromBoolean(detachVolumeRequest.isForce())); } return request; } }
/** * Constructs a new DetachVolumeRequest object. * Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param volumeId The ID of the volume. */ public DetachVolumeRequest(String volumeId) { setVolumeId(volumeId); }
public Request<DetachVolumeRequest> marshall(DetachVolumeRequest detachVolumeRequest) { if (detachVolumeRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<DetachVolumeRequest> request = new DefaultRequest<DetachVolumeRequest>(detachVolumeRequest, "AmazonEC2"); request.addParameter("Action", "DetachVolume"); request.addParameter("Version", "2016-11-15"); request.setHttpMethod(HttpMethodName.POST); if (detachVolumeRequest.getDevice() != null) { request.addParameter("Device", StringUtils.fromString(detachVolumeRequest.getDevice())); } if (detachVolumeRequest.getForce() != null) { request.addParameter("Force", StringUtils.fromBoolean(detachVolumeRequest.getForce())); } if (detachVolumeRequest.getInstanceId() != null) { request.addParameter("InstanceId", StringUtils.fromString(detachVolumeRequest.getInstanceId())); } if (detachVolumeRequest.getVolumeId() != null) { request.addParameter("VolumeId", StringUtils.fromString(detachVolumeRequest.getVolumeId())); } return request; }
/** * <p> * The ID of the volume. * </p> * * @param volumeId * The ID of the volume. * @return Returns a reference to this object so that method calls can be chained together. */ public DetachVolumeRequest withVolumeId(String volumeId) { setVolumeId(volumeId); return this; }