com.amazonaws.services.codepipeline.model.ActionExecution Maven / Gradle / Ivy
/*
* Copyright 2011-2016 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.codepipeline.model;
import java.io.Serializable;
/**
*
* Represents information about the run of an action.
*
*/
public class ActionExecution implements Serializable, Cloneable {
/**
*
* The status of the action, or for a completed action, the last status of the action.
*
*/
private String status;
/**
*
* A summary of the run of the action.
*
*/
private String summary;
/**
*
* The last status change of the action.
*
*/
private java.util.Date lastStatusChange;
/**
*
* The system-generated token used to identify a unique approval request. The token for each open approval request
* can be obtained using the GetPipelineState command and is used to validate that the approval request
* corresponding to this token is still valid.
*
*/
private String token;
/**
*
* The ARN of the user who last changed the pipeline.
*
*/
private String lastUpdatedBy;
/**
*
* The external ID of the run of the action.
*
*/
private String externalExecutionId;
/**
*
* The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
*
*/
private String externalExecutionUrl;
/**
*
* A percentage of completeness of the action as it runs.
*
*/
private Integer percentComplete;
/**
*
* The details of an error returned by a URL external to AWS.
*
*/
private ErrorDetails errorDetails;
/**
*
* The status of the action, or for a completed action, the last status of the action.
*
*
* @param status
* The status of the action, or for a completed action, the last status of the action.
* @see ActionExecutionStatus
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of the action, or for a completed action, the last status of the action.
*
*
* @return The status of the action, or for a completed action, the last status of the action.
* @see ActionExecutionStatus
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of the action, or for a completed action, the last status of the action.
*
*
* @param status
* The status of the action, or for a completed action, the last status of the action.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ActionExecutionStatus
*/
public ActionExecution withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The status of the action, or for a completed action, the last status of the action.
*
*
* @param status
* The status of the action, or for a completed action, the last status of the action.
* @see ActionExecutionStatus
*/
public void setStatus(ActionExecutionStatus status) {
this.status = status.toString();
}
/**
*
* The status of the action, or for a completed action, the last status of the action.
*
*
* @param status
* The status of the action, or for a completed action, the last status of the action.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ActionExecutionStatus
*/
public ActionExecution withStatus(ActionExecutionStatus status) {
setStatus(status);
return this;
}
/**
*
* A summary of the run of the action.
*
*
* @param summary
* A summary of the run of the action.
*/
public void setSummary(String summary) {
this.summary = summary;
}
/**
*
* A summary of the run of the action.
*
*
* @return A summary of the run of the action.
*/
public String getSummary() {
return this.summary;
}
/**
*
* A summary of the run of the action.
*
*
* @param summary
* A summary of the run of the action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withSummary(String summary) {
setSummary(summary);
return this;
}
/**
*
* The last status change of the action.
*
*
* @param lastStatusChange
* The last status change of the action.
*/
public void setLastStatusChange(java.util.Date lastStatusChange) {
this.lastStatusChange = lastStatusChange;
}
/**
*
* The last status change of the action.
*
*
* @return The last status change of the action.
*/
public java.util.Date getLastStatusChange() {
return this.lastStatusChange;
}
/**
*
* The last status change of the action.
*
*
* @param lastStatusChange
* The last status change of the action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withLastStatusChange(java.util.Date lastStatusChange) {
setLastStatusChange(lastStatusChange);
return this;
}
/**
*
* The system-generated token used to identify a unique approval request. The token for each open approval request
* can be obtained using the GetPipelineState command and is used to validate that the approval request
* corresponding to this token is still valid.
*
*
* @param token
* The system-generated token used to identify a unique approval request. The token for each open approval
* request can be obtained using the GetPipelineState command and is used to validate that the approval
* request corresponding to this token is still valid.
*/
public void setToken(String token) {
this.token = token;
}
/**
*
* The system-generated token used to identify a unique approval request. The token for each open approval request
* can be obtained using the GetPipelineState command and is used to validate that the approval request
* corresponding to this token is still valid.
*
*
* @return The system-generated token used to identify a unique approval request. The token for each open approval
* request can be obtained using the GetPipelineState command and is used to validate that the approval
* request corresponding to this token is still valid.
*/
public String getToken() {
return this.token;
}
/**
*
* The system-generated token used to identify a unique approval request. The token for each open approval request
* can be obtained using the GetPipelineState command and is used to validate that the approval request
* corresponding to this token is still valid.
*
*
* @param token
* The system-generated token used to identify a unique approval request. The token for each open approval
* request can be obtained using the GetPipelineState command and is used to validate that the approval
* request corresponding to this token is still valid.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withToken(String token) {
setToken(token);
return this;
}
/**
*
* The ARN of the user who last changed the pipeline.
*
*
* @param lastUpdatedBy
* The ARN of the user who last changed the pipeline.
*/
public void setLastUpdatedBy(String lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}
/**
*
* The ARN of the user who last changed the pipeline.
*
*
* @return The ARN of the user who last changed the pipeline.
*/
public String getLastUpdatedBy() {
return this.lastUpdatedBy;
}
/**
*
* The ARN of the user who last changed the pipeline.
*
*
* @param lastUpdatedBy
* The ARN of the user who last changed the pipeline.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withLastUpdatedBy(String lastUpdatedBy) {
setLastUpdatedBy(lastUpdatedBy);
return this;
}
/**
*
* The external ID of the run of the action.
*
*
* @param externalExecutionId
* The external ID of the run of the action.
*/
public void setExternalExecutionId(String externalExecutionId) {
this.externalExecutionId = externalExecutionId;
}
/**
*
* The external ID of the run of the action.
*
*
* @return The external ID of the run of the action.
*/
public String getExternalExecutionId() {
return this.externalExecutionId;
}
/**
*
* The external ID of the run of the action.
*
*
* @param externalExecutionId
* The external ID of the run of the action.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withExternalExecutionId(String externalExecutionId) {
setExternalExecutionId(externalExecutionId);
return this;
}
/**
*
* The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
*
*
* @param externalExecutionUrl
* The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
*/
public void setExternalExecutionUrl(String externalExecutionUrl) {
this.externalExecutionUrl = externalExecutionUrl;
}
/**
*
* The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
*
*
* @return The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
*/
public String getExternalExecutionUrl() {
return this.externalExecutionUrl;
}
/**
*
* The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
*
*
* @param externalExecutionUrl
* The URL of a resource external to AWS that will be used when running the action, for example an external
* repository URL.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withExternalExecutionUrl(String externalExecutionUrl) {
setExternalExecutionUrl(externalExecutionUrl);
return this;
}
/**
*
* A percentage of completeness of the action as it runs.
*
*
* @param percentComplete
* A percentage of completeness of the action as it runs.
*/
public void setPercentComplete(Integer percentComplete) {
this.percentComplete = percentComplete;
}
/**
*
* A percentage of completeness of the action as it runs.
*
*
* @return A percentage of completeness of the action as it runs.
*/
public Integer getPercentComplete() {
return this.percentComplete;
}
/**
*
* A percentage of completeness of the action as it runs.
*
*
* @param percentComplete
* A percentage of completeness of the action as it runs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withPercentComplete(Integer percentComplete) {
setPercentComplete(percentComplete);
return this;
}
/**
*
* The details of an error returned by a URL external to AWS.
*
*
* @param errorDetails
* The details of an error returned by a URL external to AWS.
*/
public void setErrorDetails(ErrorDetails errorDetails) {
this.errorDetails = errorDetails;
}
/**
*
* The details of an error returned by a URL external to AWS.
*
*
* @return The details of an error returned by a URL external to AWS.
*/
public ErrorDetails getErrorDetails() {
return this.errorDetails;
}
/**
*
* The details of an error returned by a URL external to AWS.
*
*
* @param errorDetails
* The details of an error returned by a URL external to AWS.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ActionExecution withErrorDetails(ErrorDetails errorDetails) {
setErrorDetails(errorDetails);
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 (getStatus() != null)
sb.append("Status: " + getStatus() + ",");
if (getSummary() != null)
sb.append("Summary: " + getSummary() + ",");
if (getLastStatusChange() != null)
sb.append("LastStatusChange: " + getLastStatusChange() + ",");
if (getToken() != null)
sb.append("Token: " + getToken() + ",");
if (getLastUpdatedBy() != null)
sb.append("LastUpdatedBy: " + getLastUpdatedBy() + ",");
if (getExternalExecutionId() != null)
sb.append("ExternalExecutionId: " + getExternalExecutionId() + ",");
if (getExternalExecutionUrl() != null)
sb.append("ExternalExecutionUrl: " + getExternalExecutionUrl() + ",");
if (getPercentComplete() != null)
sb.append("PercentComplete: " + getPercentComplete() + ",");
if (getErrorDetails() != null)
sb.append("ErrorDetails: " + getErrorDetails());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ActionExecution == false)
return false;
ActionExecution other = (ActionExecution) obj;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getSummary() == null ^ this.getSummary() == null)
return false;
if (other.getSummary() != null && other.getSummary().equals(this.getSummary()) == false)
return false;
if (other.getLastStatusChange() == null ^ this.getLastStatusChange() == null)
return false;
if (other.getLastStatusChange() != null && other.getLastStatusChange().equals(this.getLastStatusChange()) == false)
return false;
if (other.getToken() == null ^ this.getToken() == null)
return false;
if (other.getToken() != null && other.getToken().equals(this.getToken()) == false)
return false;
if (other.getLastUpdatedBy() == null ^ this.getLastUpdatedBy() == null)
return false;
if (other.getLastUpdatedBy() != null && other.getLastUpdatedBy().equals(this.getLastUpdatedBy()) == false)
return false;
if (other.getExternalExecutionId() == null ^ this.getExternalExecutionId() == null)
return false;
if (other.getExternalExecutionId() != null && other.getExternalExecutionId().equals(this.getExternalExecutionId()) == false)
return false;
if (other.getExternalExecutionUrl() == null ^ this.getExternalExecutionUrl() == null)
return false;
if (other.getExternalExecutionUrl() != null && other.getExternalExecutionUrl().equals(this.getExternalExecutionUrl()) == false)
return false;
if (other.getPercentComplete() == null ^ this.getPercentComplete() == null)
return false;
if (other.getPercentComplete() != null && other.getPercentComplete().equals(this.getPercentComplete()) == false)
return false;
if (other.getErrorDetails() == null ^ this.getErrorDetails() == null)
return false;
if (other.getErrorDetails() != null && other.getErrorDetails().equals(this.getErrorDetails()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getSummary() == null) ? 0 : getSummary().hashCode());
hashCode = prime * hashCode + ((getLastStatusChange() == null) ? 0 : getLastStatusChange().hashCode());
hashCode = prime * hashCode + ((getToken() == null) ? 0 : getToken().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedBy() == null) ? 0 : getLastUpdatedBy().hashCode());
hashCode = prime * hashCode + ((getExternalExecutionId() == null) ? 0 : getExternalExecutionId().hashCode());
hashCode = prime * hashCode + ((getExternalExecutionUrl() == null) ? 0 : getExternalExecutionUrl().hashCode());
hashCode = prime * hashCode + ((getPercentComplete() == null) ? 0 : getPercentComplete().hashCode());
hashCode = prime * hashCode + ((getErrorDetails() == null) ? 0 : getErrorDetails().hashCode());
return hashCode;
}
@Override
public ActionExecution clone() {
try {
return (ActionExecution) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}