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();
}
Aggregations