You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CreateRequest.java 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2019 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.rules;
  21. import java.util.List;
  22. import javax.annotation.Generated;
  23. /**
  24. * This is part of the internal API.
  25. * This is a POST request.
  26. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/rules/create">Further information about this action online (including a response example)</a>
  27. * @since 4.4
  28. */
  29. @Generated("sonar-ws-generator")
  30. public class CreateRequest {
  31. private String customKey;
  32. private String markdownDescription;
  33. private String name;
  34. private List<String> params;
  35. private String preventReactivation;
  36. private String severity;
  37. private String status;
  38. private String templateKey;
  39. private String type;
  40. /**
  41. * This is a mandatory parameter.
  42. * Example value: "Todo_should_not_be_used"
  43. */
  44. public CreateRequest setCustomKey(String customKey) {
  45. this.customKey = customKey;
  46. return this;
  47. }
  48. public String getCustomKey() {
  49. return customKey;
  50. }
  51. /**
  52. * This is a mandatory parameter.
  53. * Example value: "Description of my custom rule"
  54. */
  55. public CreateRequest setMarkdownDescription(String markdownDescription) {
  56. this.markdownDescription = markdownDescription;
  57. return this;
  58. }
  59. public String getMarkdownDescription() {
  60. return markdownDescription;
  61. }
  62. /**
  63. * This is a mandatory parameter.
  64. * Example value: "My custom rule"
  65. */
  66. public CreateRequest setName(String name) {
  67. this.name = name;
  68. return this;
  69. }
  70. public String getName() {
  71. return name;
  72. }
  73. /**
  74. */
  75. public CreateRequest setParams(List<String> params) {
  76. this.params = params;
  77. return this;
  78. }
  79. public List<String> getParams() {
  80. return params;
  81. }
  82. /**
  83. * Possible values:
  84. * <ul>
  85. * <li>"true"</li>
  86. * <li>"false"</li>
  87. * <li>"yes"</li>
  88. * <li>"no"</li>
  89. * </ul>
  90. */
  91. public CreateRequest setPreventReactivation(String preventReactivation) {
  92. this.preventReactivation = preventReactivation;
  93. return this;
  94. }
  95. public String getPreventReactivation() {
  96. return preventReactivation;
  97. }
  98. /**
  99. * Possible values:
  100. * <ul>
  101. * <li>"INFO"</li>
  102. * <li>"MINOR"</li>
  103. * <li>"MAJOR"</li>
  104. * <li>"CRITICAL"</li>
  105. * <li>"BLOCKER"</li>
  106. * </ul>
  107. */
  108. public CreateRequest setSeverity(String severity) {
  109. this.severity = severity;
  110. return this;
  111. }
  112. public String getSeverity() {
  113. return severity;
  114. }
  115. /**
  116. * Possible values:
  117. * <ul>
  118. * <li>"BETA"</li>
  119. * <li>"DEPRECATED"</li>
  120. * <li>"READY"</li>
  121. * <li>"REMOVED"</li>
  122. * </ul>
  123. */
  124. public CreateRequest setStatus(String status) {
  125. this.status = status;
  126. return this;
  127. }
  128. public String getStatus() {
  129. return status;
  130. }
  131. /**
  132. * Example value: "java:XPath"
  133. */
  134. public CreateRequest setTemplateKey(String templateKey) {
  135. this.templateKey = templateKey;
  136. return this;
  137. }
  138. public String getTemplateKey() {
  139. return templateKey;
  140. }
  141. /**
  142. * Possible values:
  143. * <ul>
  144. * <li>"CODE_SMELL"</li>
  145. * <li>"BUG"</li>
  146. * <li>"VULNERABILITY"</li>
  147. * </ul>
  148. */
  149. public CreateRequest setType(String type) {
  150. this.type = type;
  151. return this;
  152. }
  153. public String getType() {
  154. return type;
  155. }
  156. }