Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

CustomMeasuresService.java 4.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2018 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonarqube.ws.client.custommeasures;
  21. import java.util.stream.Collectors;
  22. import javax.annotation.Generated;
  23. import org.sonarqube.ws.MediaTypes;
  24. import org.sonarqube.ws.client.BaseService;
  25. import org.sonarqube.ws.client.GetRequest;
  26. import org.sonarqube.ws.client.PostRequest;
  27. import org.sonarqube.ws.client.WsConnector;
  28. /**
  29. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/custom_measures">Further information about this web service online</a>
  30. */
  31. @Generated("sonar-ws-generator")
  32. public class CustomMeasuresService extends BaseService {
  33. public CustomMeasuresService(WsConnector wsConnector) {
  34. super(wsConnector, "api/custom_measures");
  35. }
  36. /**
  37. *
  38. * This is part of the internal API.
  39. * This is a POST request.
  40. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/custom_measures/create">Further information about this action online (including a response example)</a>
  41. * @since 5.2
  42. * @deprecated since 7.4
  43. */
  44. public void create(CreateRequest request) {
  45. call(
  46. new PostRequest(path("create"))
  47. .setParam("description", request.getDescription())
  48. .setParam("metricId", request.getMetricId())
  49. .setParam("metricKey", request.getMetricKey())
  50. .setParam("projectId", request.getProjectId())
  51. .setParam("projectKey", request.getProjectKey())
  52. .setParam("value", request.getValue())
  53. .setMediaType(MediaTypes.JSON)
  54. ).content();
  55. }
  56. /**
  57. *
  58. * This is part of the internal API.
  59. * This is a POST request.
  60. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/custom_measures/delete">Further information about this action online (including a response example)</a>
  61. * @since 5.2
  62. * @deprecated since 7.4
  63. */
  64. public void delete(DeleteRequest request) {
  65. call(
  66. new PostRequest(path("delete"))
  67. .setParam("id", request.getId())
  68. .setMediaType(MediaTypes.JSON)
  69. ).content();
  70. }
  71. /**
  72. *
  73. * This is part of the internal API.
  74. * This is a GET request.
  75. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/custom_measures/metrics">Further information about this action online (including a response example)</a>
  76. * @since 5.2
  77. * @deprecated since 7.4
  78. */
  79. public String metrics(MetricsRequest request) {
  80. return call(
  81. new GetRequest(path("metrics"))
  82. .setParam("projectId", request.getProjectId())
  83. .setParam("projectKey", request.getProjectKey())
  84. .setMediaType(MediaTypes.JSON)
  85. ).content();
  86. }
  87. /**
  88. *
  89. * This is part of the internal API.
  90. * This is a GET request.
  91. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/custom_measures/search">Further information about this action online (including a response example)</a>
  92. * @since 5.2
  93. * @deprecated since 7.4
  94. */
  95. public String search(SearchRequest request) {
  96. return call(
  97. new GetRequest(path("search"))
  98. .setParam("f", request.getF() == null ? null : request.getF().stream().collect(Collectors.joining(",")))
  99. .setParam("p", request.getP())
  100. .setParam("projectId", request.getProjectId())
  101. .setParam("projectKey", request.getProjectKey())
  102. .setParam("ps", request.getPs())
  103. .setMediaType(MediaTypes.JSON)
  104. ).content();
  105. }
  106. /**
  107. *
  108. * This is part of the internal API.
  109. * This is a POST request.
  110. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/custom_measures/update">Further information about this action online (including a response example)</a>
  111. * @since 5.2
  112. * @deprecated since 7.4
  113. */
  114. public void update(UpdateRequest request) {
  115. call(
  116. new PostRequest(path("update"))
  117. .setParam("description", request.getDescription())
  118. .setParam("id", request.getId())
  119. .setParam("value", request.getValue())
  120. .setMediaType(MediaTypes.JSON)
  121. ).content();
  122. }
  123. }