com.amazonaws.services.codedeploy.model.InstanceSummary Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codedeploy Show documentation
/*
* Copyright 2013-2018 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.codedeploy.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about an instance in a deployment.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class InstanceSummary implements Serializable, Cloneable, StructuredPojo {
/**
*
* The deployment ID.
*
*/
private String deploymentId;
/**
*
* The instance ID.
*
*/
private String instanceId;
/**
*
* The deployment status for this instance:
*
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
*
*/
private String status;
/**
*
* A timestamp indicating when the instance information was last updated.
*
*/
private java.util.Date lastUpdatedAt;
/**
*
* A list of lifecycle events for this instance.
*
*/
private com.amazonaws.internal.SdkInternalList lifecycleEvents;
/**
*
* Information about which environment an instance belongs to in a blue/green deployment.
*
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
*
*/
private String instanceType;
/**
*
* The deployment ID.
*
*
* @param deploymentId
* The deployment ID.
*/
public void setDeploymentId(String deploymentId) {
this.deploymentId = deploymentId;
}
/**
*
* The deployment ID.
*
*
* @return The deployment ID.
*/
public String getDeploymentId() {
return this.deploymentId;
}
/**
*
* The deployment ID.
*
*
* @param deploymentId
* The deployment ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceSummary withDeploymentId(String deploymentId) {
setDeploymentId(deploymentId);
return this;
}
/**
*
* The instance ID.
*
*
* @param instanceId
* The instance ID.
*/
public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}
/**
*
* The instance ID.
*
*
* @return The instance ID.
*/
public String getInstanceId() {
return this.instanceId;
}
/**
*
* The instance ID.
*
*
* @param instanceId
* The instance ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceSummary withInstanceId(String instanceId) {
setInstanceId(instanceId);
return this;
}
/**
*
* The deployment status for this instance:
*
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
*
*
* @param status
* The deployment status for this instance:
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
* @see InstanceStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The deployment status for this instance:
*
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
*
*
* @return The deployment status for this instance:
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
* @see InstanceStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The deployment status for this instance:
*
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
*
*
* @param status
* The deployment status for this instance:
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceStatus
*/
public InstanceSummary withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The deployment status for this instance:
*
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
*
*
* @param status
* The deployment status for this instance:
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
* @see InstanceStatus
*/
public void setStatus(InstanceStatus status) {
withStatus(status);
}
/**
*
* The deployment status for this instance:
*
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
*
*
* @param status
* The deployment status for this instance:
*
* -
*
* Pending: The deployment is pending for this instance.
*
*
* -
*
* In Progress: The deployment is in progress for this instance.
*
*
* -
*
* Succeeded: The deployment has succeeded for this instance.
*
*
* -
*
* Failed: The deployment has failed for this instance.
*
*
* -
*
* Skipped: The deployment has been skipped for this instance.
*
*
* -
*
* Unknown: The deployment status is unknown for this instance.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceStatus
*/
public InstanceSummary withStatus(InstanceStatus status) {
this.status = status.toString();
return this;
}
/**
*
* A timestamp indicating when the instance information was last updated.
*
*
* @param lastUpdatedAt
* A timestamp indicating when the instance information was last updated.
*/
public void setLastUpdatedAt(java.util.Date lastUpdatedAt) {
this.lastUpdatedAt = lastUpdatedAt;
}
/**
*
* A timestamp indicating when the instance information was last updated.
*
*
* @return A timestamp indicating when the instance information was last updated.
*/
public java.util.Date getLastUpdatedAt() {
return this.lastUpdatedAt;
}
/**
*
* A timestamp indicating when the instance information was last updated.
*
*
* @param lastUpdatedAt
* A timestamp indicating when the instance information was last updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceSummary withLastUpdatedAt(java.util.Date lastUpdatedAt) {
setLastUpdatedAt(lastUpdatedAt);
return this;
}
/**
*
* A list of lifecycle events for this instance.
*
*
* @return A list of lifecycle events for this instance.
*/
public java.util.List getLifecycleEvents() {
if (lifecycleEvents == null) {
lifecycleEvents = new com.amazonaws.internal.SdkInternalList();
}
return lifecycleEvents;
}
/**
*
* A list of lifecycle events for this instance.
*
*
* @param lifecycleEvents
* A list of lifecycle events for this instance.
*/
public void setLifecycleEvents(java.util.Collection lifecycleEvents) {
if (lifecycleEvents == null) {
this.lifecycleEvents = null;
return;
}
this.lifecycleEvents = new com.amazonaws.internal.SdkInternalList(lifecycleEvents);
}
/**
*
* A list of lifecycle events for this instance.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setLifecycleEvents(java.util.Collection)} or {@link #withLifecycleEvents(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param lifecycleEvents
* A list of lifecycle events for this instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceSummary withLifecycleEvents(LifecycleEvent... lifecycleEvents) {
if (this.lifecycleEvents == null) {
setLifecycleEvents(new com.amazonaws.internal.SdkInternalList(lifecycleEvents.length));
}
for (LifecycleEvent ele : lifecycleEvents) {
this.lifecycleEvents.add(ele);
}
return this;
}
/**
*
* A list of lifecycle events for this instance.
*
*
* @param lifecycleEvents
* A list of lifecycle events for this instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public InstanceSummary withLifecycleEvents(java.util.Collection lifecycleEvents) {
setLifecycleEvents(lifecycleEvents);
return this;
}
/**
*
* Information about which environment an instance belongs to in a blue/green deployment.
*
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
*
*
* @param instanceType
* Information about which environment an instance belongs to in a blue/green deployment.
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
* @see InstanceType
*/
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
/**
*
* Information about which environment an instance belongs to in a blue/green deployment.
*
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
*
*
* @return Information about which environment an instance belongs to in a blue/green deployment.
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
* @see InstanceType
*/
public String getInstanceType() {
return this.instanceType;
}
/**
*
* Information about which environment an instance belongs to in a blue/green deployment.
*
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
*
*
* @param instanceType
* Information about which environment an instance belongs to in a blue/green deployment.
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public InstanceSummary withInstanceType(String instanceType) {
setInstanceType(instanceType);
return this;
}
/**
*
* Information about which environment an instance belongs to in a blue/green deployment.
*
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
*
*
* @param instanceType
* Information about which environment an instance belongs to in a blue/green deployment.
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
* @see InstanceType
*/
public void setInstanceType(InstanceType instanceType) {
withInstanceType(instanceType);
}
/**
*
* Information about which environment an instance belongs to in a blue/green deployment.
*
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
*
*
* @param instanceType
* Information about which environment an instance belongs to in a blue/green deployment.
*
* -
*
* BLUE: The instance is part of the original environment.
*
*
* -
*
* GREEN: The instance is part of the replacement environment.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
* @see InstanceType
*/
public InstanceSummary withInstanceType(InstanceType instanceType) {
this.instanceType = instanceType.toString();
return this;
}
/**
* 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 (getDeploymentId() != null)
sb.append("DeploymentId: ").append(getDeploymentId()).append(",");
if (getInstanceId() != null)
sb.append("InstanceId: ").append(getInstanceId()).append(",");
if (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getLastUpdatedAt() != null)
sb.append("LastUpdatedAt: ").append(getLastUpdatedAt()).append(",");
if (getLifecycleEvents() != null)
sb.append("LifecycleEvents: ").append(getLifecycleEvents()).append(",");
if (getInstanceType() != null)
sb.append("InstanceType: ").append(getInstanceType());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof InstanceSummary == false)
return false;
InstanceSummary other = (InstanceSummary) obj;
if (other.getDeploymentId() == null ^ this.getDeploymentId() == null)
return false;
if (other.getDeploymentId() != null && other.getDeploymentId().equals(this.getDeploymentId()) == 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.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getLastUpdatedAt() == null ^ this.getLastUpdatedAt() == null)
return false;
if (other.getLastUpdatedAt() != null && other.getLastUpdatedAt().equals(this.getLastUpdatedAt()) == false)
return false;
if (other.getLifecycleEvents() == null ^ this.getLifecycleEvents() == null)
return false;
if (other.getLifecycleEvents() != null && other.getLifecycleEvents().equals(this.getLifecycleEvents()) == false)
return false;
if (other.getInstanceType() == null ^ this.getInstanceType() == null)
return false;
if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDeploymentId() == null) ? 0 : getDeploymentId().hashCode());
hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode());
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedAt() == null) ? 0 : getLastUpdatedAt().hashCode());
hashCode = prime * hashCode + ((getLifecycleEvents() == null) ? 0 : getLifecycleEvents().hashCode());
hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
return hashCode;
}
@Override
public InstanceSummary clone() {
try {
return (InstanceSummary) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.codedeploy.model.transform.InstanceSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}