/* * 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.codebuild.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Contains information about a stage for a batch build. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BuildBatchPhase implements Serializable, Cloneable, StructuredPojo { /** *

* The name of the batch build phase. Valid values include: *

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
*
*/ private String phaseType; /** *

* The current status of the batch build phase. Valid values include: *

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
*
*/ private String phaseStatus; /** *

* When the batch build phase started, expressed in Unix time format. *

*/ private java.util.Date startTime; /** *

* When the batch build phase ended, expressed in Unix time format. *

*/ private java.util.Date endTime; /** *

* How long, in seconds, between the starting and ending times of the batch build's phase. *

*/ private Long durationInSeconds; /** *

* Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. *

*/ private java.util.List contexts; /** *

* The name of the batch build phase. Valid values include: *

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
*
* * @param phaseType * The name of the batch build phase. Valid values include:

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
* @see BuildBatchPhaseType */ public void setPhaseType(String phaseType) { this.phaseType = phaseType; } /** *

* The name of the batch build phase. Valid values include: *

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
*
* * @return The name of the batch build phase. Valid values include:

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
* @see BuildBatchPhaseType */ public String getPhaseType() { return this.phaseType; } /** *

* The name of the batch build phase. Valid values include: *

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
*
* * @param phaseType * The name of the batch build phase. Valid values include:

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see BuildBatchPhaseType */ public BuildBatchPhase withPhaseType(String phaseType) { setPhaseType(phaseType); return this; } /** *

* The name of the batch build phase. Valid values include: *

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
*
* * @param phaseType * The name of the batch build phase. Valid values include:

*
*
COMBINE_ARTIFACTS
*
*

* Build output artifacts are being combined and uploaded to the output location. *

*
*
DOWNLOAD_BATCHSPEC
*
*

* The batch build specification is being downloaded. *

*
*
FAILED
*
*

* One or more of the builds failed. *

*
*
IN_PROGRESS
*
*

* The batch build is in progress. *

*
*
STOPPED
*
*

* The batch build was stopped. *

*
*
SUBMITTED
*
*

* The btach build has been submitted. *

*
*
SUCCEEDED
*
*

* The batch build succeeded. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see BuildBatchPhaseType */ public BuildBatchPhase withPhaseType(BuildBatchPhaseType phaseType) { this.phaseType = phaseType.toString(); return this; } /** *

* The current status of the batch build phase. Valid values include: *

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
*
* * @param phaseStatus * The current status of the batch build phase. Valid values include:

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
* @see StatusType */ public void setPhaseStatus(String phaseStatus) { this.phaseStatus = phaseStatus; } /** *

* The current status of the batch build phase. Valid values include: *

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
*
* * @return The current status of the batch build phase. Valid values include:

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
* @see StatusType */ public String getPhaseStatus() { return this.phaseStatus; } /** *

* The current status of the batch build phase. Valid values include: *

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
*
* * @param phaseStatus * The current status of the batch build phase. Valid values include:

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see StatusType */ public BuildBatchPhase withPhaseStatus(String phaseStatus) { setPhaseStatus(phaseStatus); return this; } /** *

* The current status of the batch build phase. Valid values include: *

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
*
* * @param phaseStatus * The current status of the batch build phase. Valid values include:

*
*
FAILED
*
*

* The build phase failed. *

*
*
FAULT
*
*

* The build phase faulted. *

*
*
IN_PROGRESS
*
*

* The build phase is still in progress. *

*
*
STOPPED
*
*

* The build phase stopped. *

*
*
SUCCEEDED
*
*

* The build phase succeeded. *

*
*
TIMED_OUT
*
*

* The build phase timed out. *

*
* @return Returns a reference to this object so that method calls can be chained together. * @see StatusType */ public BuildBatchPhase withPhaseStatus(StatusType phaseStatus) { this.phaseStatus = phaseStatus.toString(); return this; } /** *

* When the batch build phase started, expressed in Unix time format. *

* * @param startTime * When the batch build phase started, expressed in Unix time format. */ public void setStartTime(java.util.Date startTime) { this.startTime = startTime; } /** *

* When the batch build phase started, expressed in Unix time format. *

* * @return When the batch build phase started, expressed in Unix time format. */ public java.util.Date getStartTime() { return this.startTime; } /** *

* When the batch build phase started, expressed in Unix time format. *

* * @param startTime * When the batch build phase started, expressed in Unix time format. * @return Returns a reference to this object so that method calls can be chained together. */ public BuildBatchPhase withStartTime(java.util.Date startTime) { setStartTime(startTime); return this; } /** *

* When the batch build phase ended, expressed in Unix time format. *

* * @param endTime * When the batch build phase ended, expressed in Unix time format. */ public void setEndTime(java.util.Date endTime) { this.endTime = endTime; } /** *

* When the batch build phase ended, expressed in Unix time format. *

* * @return When the batch build phase ended, expressed in Unix time format. */ public java.util.Date getEndTime() { return this.endTime; } /** *

* When the batch build phase ended, expressed in Unix time format. *

* * @param endTime * When the batch build phase ended, expressed in Unix time format. * @return Returns a reference to this object so that method calls can be chained together. */ public BuildBatchPhase withEndTime(java.util.Date endTime) { setEndTime(endTime); return this; } /** *

* How long, in seconds, between the starting and ending times of the batch build's phase. *

* * @param durationInSeconds * How long, in seconds, between the starting and ending times of the batch build's phase. */ public void setDurationInSeconds(Long durationInSeconds) { this.durationInSeconds = durationInSeconds; } /** *

* How long, in seconds, between the starting and ending times of the batch build's phase. *

* * @return How long, in seconds, between the starting and ending times of the batch build's phase. */ public Long getDurationInSeconds() { return this.durationInSeconds; } /** *

* How long, in seconds, between the starting and ending times of the batch build's phase. *

* * @param durationInSeconds * How long, in seconds, between the starting and ending times of the batch build's phase. * @return Returns a reference to this object so that method calls can be chained together. */ public BuildBatchPhase withDurationInSeconds(Long durationInSeconds) { setDurationInSeconds(durationInSeconds); return this; } /** *

* Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. *

* * @return Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. */ public java.util.List getContexts() { return contexts; } /** *

* Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. *

* * @param contexts * Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. */ public void setContexts(java.util.Collection contexts) { if (contexts == null) { this.contexts = null; return; } this.contexts = new java.util.ArrayList(contexts); } /** *

* Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setContexts(java.util.Collection)} or {@link #withContexts(java.util.Collection)} if you want to override * the existing values. *

* * @param contexts * Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. * @return Returns a reference to this object so that method calls can be chained together. */ public BuildBatchPhase withContexts(PhaseContext... contexts) { if (this.contexts == null) { setContexts(new java.util.ArrayList(contexts.length)); } for (PhaseContext ele : contexts) { this.contexts.add(ele); } return this; } /** *

* Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. *

* * @param contexts * Additional information about the batch build phase. Especially to help troubleshoot a failed batch build. * @return Returns a reference to this object so that method calls can be chained together. */ public BuildBatchPhase withContexts(java.util.Collection contexts) { setContexts(contexts); 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 (getPhaseType() != null) sb.append("PhaseType: ").append(getPhaseType()).append(","); if (getPhaseStatus() != null) sb.append("PhaseStatus: ").append(getPhaseStatus()).append(","); if (getStartTime() != null) sb.append("StartTime: ").append(getStartTime()).append(","); if (getEndTime() != null) sb.append("EndTime: ").append(getEndTime()).append(","); if (getDurationInSeconds() != null) sb.append("DurationInSeconds: ").append(getDurationInSeconds()).append(","); if (getContexts() != null) sb.append("Contexts: ").append(getContexts()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BuildBatchPhase == false) return false; BuildBatchPhase other = (BuildBatchPhase) obj; if (other.getPhaseType() == null ^ this.getPhaseType() == null) return false; if (other.getPhaseType() != null && other.getPhaseType().equals(this.getPhaseType()) == false) return false; if (other.getPhaseStatus() == null ^ this.getPhaseStatus() == null) return false; if (other.getPhaseStatus() != null && other.getPhaseStatus().equals(this.getPhaseStatus()) == 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.getEndTime() == null ^ this.getEndTime() == null) return false; if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false) return false; if (other.getDurationInSeconds() == null ^ this.getDurationInSeconds() == null) return false; if (other.getDurationInSeconds() != null && other.getDurationInSeconds().equals(this.getDurationInSeconds()) == false) return false; if (other.getContexts() == null ^ this.getContexts() == null) return false; if (other.getContexts() != null && other.getContexts().equals(this.getContexts()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPhaseType() == null) ? 0 : getPhaseType().hashCode()); hashCode = prime * hashCode + ((getPhaseStatus() == null) ? 0 : getPhaseStatus().hashCode()); hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); hashCode = prime * hashCode + ((getDurationInSeconds() == null) ? 0 : getDurationInSeconds().hashCode()); hashCode = prime * hashCode + ((getContexts() == null) ? 0 : getContexts().hashCode()); return hashCode; } @Override public BuildBatchPhase clone() { try { return (BuildBatchPhase) 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.codebuild.model.transform.BuildBatchPhaseMarshaller.getInstance().marshall(this, protocolMarshaller); } }