Search in sources :

Example 1 with UpdateConditionWsResponse

use of org.sonarqube.ws.WsQualityGates.UpdateConditionWsResponse in project sonarqube by SonarSource.

the class UpdateConditionAction method doHandle.

private UpdateConditionWsResponse doHandle(UpdateConditionRequest request, DbSession dbSession) {
    QualityGateConditionDto condition = qualityGateConditionsUpdater.updateCondition(dbSession, request.getConditionId(), request.getMetricKey(), request.getOperator(), request.getWarning(), request.getError(), request.getPeriod());
    UpdateConditionWsResponse.Builder response = UpdateConditionWsResponse.newBuilder().setId(condition.getId()).setMetric(condition.getMetricKey()).setOp(condition.getOperator());
    setNullable(condition.getWarningThreshold(), response::setWarning);
    setNullable(condition.getErrorThreshold(), response::setError);
    setNullable(condition.getPeriod(), response::setPeriod);
    return response.build();
}
Also used : UpdateConditionWsResponse(org.sonarqube.ws.WsQualityGates.UpdateConditionWsResponse) QualityGateConditionDto(org.sonar.db.qualitygate.QualityGateConditionDto)

Aggregations

QualityGateConditionDto (org.sonar.db.qualitygate.QualityGateConditionDto)1 UpdateConditionWsResponse (org.sonarqube.ws.WsQualityGates.UpdateConditionWsResponse)1