Search in sources :

Example 1 with WaitReason

use of jetbrains.buildServer.serverSide.buildDistribution.WaitReason in project teamcity-rest by JetBrains.

the class Build method getWaitReason.

@XmlElement(name = "waitReason")
public String getWaitReason() {
    return ValueWithDefault.decideDefault(myFields.isIncluded("waitReason", false), () -> {
        if (myQueuedBuild == null)
            return null;
        if (myQueuedBuild instanceof QueuedBuildEx) {
            return ((QueuedBuildEx) myQueuedBuild).getLatestWaitReason();
        }
        // Fallback to old way of doing things.
        final BuildEstimates buildEstimates = myQueuedBuild.getBuildEstimates();
        if (buildEstimates == null)
            return null;
        final WaitReason waitReason = buildEstimates.getWaitReason();
        if (waitReason == null)
            return null;
        return waitReason.getDescription();
    });
}
Also used : WaitReason(jetbrains.buildServer.serverSide.buildDistribution.WaitReason) XmlElement(javax.xml.bind.annotation.XmlElement)

Aggregations

XmlElement (javax.xml.bind.annotation.XmlElement)1 WaitReason (jetbrains.buildServer.serverSide.buildDistribution.WaitReason)1