/* * Copyright 2018-2023 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.ec2.model; import java.io.Serializable; import javax.annotation.Generated; /** *
* Information about a root volume replacement task. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class ReplaceRootVolumeTask implements Serializable, Cloneable { /** ** The ID of the root volume replacement task. *
*/ private String replaceRootVolumeTaskId; /** ** The ID of the instance for which the root volume replacement task was created. *
*/ private String instanceId; /** ** The state of the task. The task can be in one of the following states: *
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the instance
* is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have no
* root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume attached.
*
* The time the task was started. *
*/ private String startTime; /** ** The time the task completed. *
*/ private String completeTime; /** ** The tags assigned to the task. *
*/ private com.amazonaws.internal.SdkInternalList* The ID of the AMI used to create the replacement root volume. *
*/ private String imageId; /** ** The ID of the snapshot used to create the replacement root volume. *
*/ private String snapshotId; /** ** Indicates whether the original root volume is to be deleted after the root volume replacement task completes. *
*/ private Boolean deleteReplacedRootVolume; /** ** The ID of the root volume replacement task. *
* * @param replaceRootVolumeTaskId * The ID of the root volume replacement task. */ public void setReplaceRootVolumeTaskId(String replaceRootVolumeTaskId) { this.replaceRootVolumeTaskId = replaceRootVolumeTaskId; } /** ** The ID of the root volume replacement task. *
* * @return The ID of the root volume replacement task. */ public String getReplaceRootVolumeTaskId() { return this.replaceRootVolumeTaskId; } /** ** The ID of the root volume replacement task. *
* * @param replaceRootVolumeTaskId * The ID of the root volume replacement task. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withReplaceRootVolumeTaskId(String replaceRootVolumeTaskId) { setReplaceRootVolumeTaskId(replaceRootVolumeTaskId); return this; } /** ** The ID of the instance for which the root volume replacement task was created. *
* * @param instanceId * The ID of the instance for which the root volume replacement task was created. */ public void setInstanceId(String instanceId) { this.instanceId = instanceId; } /** ** The ID of the instance for which the root volume replacement task was created. *
* * @return The ID of the instance for which the root volume replacement task was created. */ public String getInstanceId() { return this.instanceId; } /** ** The ID of the instance for which the root volume replacement task was created. *
* * @param instanceId * The ID of the instance for which the root volume replacement task was created. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withInstanceId(String instanceId) { setInstanceId(instanceId); return this; } /** ** The state of the task. The task can be in one of the following states: *
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the instance
* is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have no
* root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume attached.
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being
* attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the
* instance is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have
* no root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume
* attached.
*
* The state of the task. The task can be in one of the following states: *
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the instance
* is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have no
* root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume attached.
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being
* attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the
* instance is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might
* have no root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume
* attached.
*
* The state of the task. The task can be in one of the following states: *
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the instance
* is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have no
* root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume attached.
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being
* attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the
* instance is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have
* no root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume
* attached.
*
* The state of the task. The task can be in one of the following states: *
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the instance
* is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have no
* root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume attached.
*
* pending
- the replacement volume is being created.
*
* in-progress
- the original volume is being detached and the replacement volume is being
* attached.
*
* succeeded
- the replacement volume has been successfully attached to the instance and the
* instance is available.
*
* failing
- the replacement task is in the process of failing.
*
* failed
- the replacement task has failed but the original root volume is still attached.
*
* failing-detached
- the replacement task is in the process of failing. The instance might have
* no root volume attached.
*
* failed-detached
- the replacement task has failed and the instance has no root volume
* attached.
*
* The time the task was started. *
* * @param startTime * The time the task was started. */ public void setStartTime(String startTime) { this.startTime = startTime; } /** ** The time the task was started. *
* * @return The time the task was started. */ public String getStartTime() { return this.startTime; } /** ** The time the task was started. *
* * @param startTime * The time the task was started. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withStartTime(String startTime) { setStartTime(startTime); return this; } /** ** The time the task completed. *
* * @param completeTime * The time the task completed. */ public void setCompleteTime(String completeTime) { this.completeTime = completeTime; } /** ** The time the task completed. *
* * @return The time the task completed. */ public String getCompleteTime() { return this.completeTime; } /** ** The time the task completed. *
* * @param completeTime * The time the task completed. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withCompleteTime(String completeTime) { setCompleteTime(completeTime); return this; } /** ** The tags assigned to the task. *
* * @return The tags assigned to the task. */ public java.util.List* The tags assigned to the task. *
* * @param tags * The tags assigned to the task. */ public void setTags(java.util.Collection* The tags assigned to the task. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the * existing values. *
* * @param tags * The tags assigned to the task. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withTags(Tag... tags) { if (this.tags == null) { setTags(new com.amazonaws.internal.SdkInternalList* The tags assigned to the task. *
* * @param tags * The tags assigned to the task. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withTags(java.util.Collection* The ID of the AMI used to create the replacement root volume. *
* * @param imageId * The ID of the AMI used to create the replacement root volume. */ public void setImageId(String imageId) { this.imageId = imageId; } /** ** The ID of the AMI used to create the replacement root volume. *
* * @return The ID of the AMI used to create the replacement root volume. */ public String getImageId() { return this.imageId; } /** ** The ID of the AMI used to create the replacement root volume. *
* * @param imageId * The ID of the AMI used to create the replacement root volume. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withImageId(String imageId) { setImageId(imageId); return this; } /** ** The ID of the snapshot used to create the replacement root volume. *
* * @param snapshotId * The ID of the snapshot used to create the replacement root volume. */ public void setSnapshotId(String snapshotId) { this.snapshotId = snapshotId; } /** ** The ID of the snapshot used to create the replacement root volume. *
* * @return The ID of the snapshot used to create the replacement root volume. */ public String getSnapshotId() { return this.snapshotId; } /** ** The ID of the snapshot used to create the replacement root volume. *
* * @param snapshotId * The ID of the snapshot used to create the replacement root volume. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withSnapshotId(String snapshotId) { setSnapshotId(snapshotId); return this; } /** ** Indicates whether the original root volume is to be deleted after the root volume replacement task completes. *
* * @param deleteReplacedRootVolume * Indicates whether the original root volume is to be deleted after the root volume replacement task * completes. */ public void setDeleteReplacedRootVolume(Boolean deleteReplacedRootVolume) { this.deleteReplacedRootVolume = deleteReplacedRootVolume; } /** ** Indicates whether the original root volume is to be deleted after the root volume replacement task completes. *
* * @return Indicates whether the original root volume is to be deleted after the root volume replacement task * completes. */ public Boolean getDeleteReplacedRootVolume() { return this.deleteReplacedRootVolume; } /** ** Indicates whether the original root volume is to be deleted after the root volume replacement task completes. *
* * @param deleteReplacedRootVolume * Indicates whether the original root volume is to be deleted after the root volume replacement task * completes. * @return Returns a reference to this object so that method calls can be chained together. */ public ReplaceRootVolumeTask withDeleteReplacedRootVolume(Boolean deleteReplacedRootVolume) { setDeleteReplacedRootVolume(deleteReplacedRootVolume); return this; } /** ** Indicates whether the original root volume is to be deleted after the root volume replacement task completes. *
* * @return Indicates whether the original root volume is to be deleted after the root volume replacement task * completes. */ public Boolean isDeleteReplacedRootVolume() { return this.deleteReplacedRootVolume; } /** * 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 (getReplaceRootVolumeTaskId() != null) sb.append("ReplaceRootVolumeTaskId: ").append(getReplaceRootVolumeTaskId()).append(","); if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getTaskState() != null) sb.append("TaskState: ").append(getTaskState()).append(","); if (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getCompleteTime() != null) sb.append("CompleteTime: ").append(getCompleteTime()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()).append(","); if (getImageId() != null) sb.append("ImageId: ").append(getImageId()).append(","); if (getSnapshotId() != null) sb.append("SnapshotId: ").append(getSnapshotId()).append(","); if (getDeleteReplacedRootVolume() != null) sb.append("DeleteReplacedRootVolume: ").append(getDeleteReplacedRootVolume()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ReplaceRootVolumeTask == false) return false; ReplaceRootVolumeTask other = (ReplaceRootVolumeTask) obj; if (other.getReplaceRootVolumeTaskId() == null ^ this.getReplaceRootVolumeTaskId() == null) return false; if (other.getReplaceRootVolumeTaskId() != null && other.getReplaceRootVolumeTaskId().equals(this.getReplaceRootVolumeTaskId()) == 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.getTaskState() == null ^ this.getTaskState() == null) return false; if (other.getTaskState() != null && other.getTaskState().equals(this.getTaskState()) == false) return false; if (other.getStartTime() == null ^ this.getStartTime() == null) return false; if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false) return false; if (other.getCompleteTime() == null ^ this.getCompleteTime() == null) return false; if (other.getCompleteTime() != null && other.getCompleteTime().equals(this.getCompleteTime()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getSnapshotId() == null ^ this.getSnapshotId() == null) return false; if (other.getSnapshotId() != null && other.getSnapshotId().equals(this.getSnapshotId()) == false) return false; if (other.getDeleteReplacedRootVolume() == null ^ this.getDeleteReplacedRootVolume() == null) return false; if (other.getDeleteReplacedRootVolume() != null && other.getDeleteReplacedRootVolume().equals(this.getDeleteReplacedRootVolume()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getReplaceRootVolumeTaskId() == null) ? 0 : getReplaceRootVolumeTaskId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getTaskState() == null) ? 0 : getTaskState().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getCompleteTime() == null) ? 0 : getCompleteTime().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getSnapshotId() == null) ? 0 : getSnapshotId().hashCode()); hashCode = prime * hashCode + ((getDeleteReplacedRootVolume() == null) ? 0 : getDeleteReplacedRootVolume().hashCode()); return hashCode; } @Override public ReplaceRootVolumeTask clone() { try { return (ReplaceRootVolumeTask) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }