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.

AlmSettingsService.java 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2020 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.almsettings;
  21. import javax.annotation.Generated;
  22. import org.sonarqube.ws.AlmSettings;
  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/alm_settings">Further information about this web service online</a>
  30. */
  31. @Generated("sonar-ws-generator")
  32. public class AlmSettingsService extends BaseService {
  33. public AlmSettingsService(WsConnector wsConnector) {
  34. super(wsConnector, "api/alm_settings");
  35. }
  36. /**
  37. * This is a GET request.
  38. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/count_binding">Further information about this action online (including a response example)</a>
  39. * @since 8.1
  40. */
  41. public AlmSettings.CountBindingWsResponse countBinding(CountBindingRequest request) {
  42. return call(
  43. new GetRequest(path("count_binding"))
  44. .setParam("almSetting", request.getAlmSetting())
  45. .setMediaType(MediaTypes.JSON),
  46. AlmSettings.CountBindingWsResponse.parser());
  47. }
  48. /**
  49. *
  50. * This is a POST request.
  51. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/create_azure">Further information about this action online (including a response example)</a>
  52. * @since 8.1
  53. */
  54. public void createAzure(CreateAzureRequest request) {
  55. call(
  56. new PostRequest(path("create_azure"))
  57. .setParam("key", request.getKey())
  58. .setParam("personalAccessToken", request.getPersonalAccessToken())
  59. .setMediaType(MediaTypes.JSON)).content();
  60. }
  61. /**
  62. *
  63. * This is a POST request.
  64. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/create_gitlab">Further information about this action online (including a response example)</a>
  65. * @since 8.1
  66. */
  67. public void createGitlab(CreateGitlabRequest request) {
  68. call(
  69. new PostRequest(path("create_gitlab"))
  70. .setParam("key", request.getKey())
  71. .setParam("personalAccessToken", request.getPersonalAccessToken())
  72. .setParam("url", request.getUrl())
  73. .setMediaType(MediaTypes.JSON)).content();
  74. }
  75. /**
  76. *
  77. * This is a POST request.
  78. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/create_bitbucket">Further information about this action online (including a response example)</a>
  79. * @since 8.1
  80. */
  81. public void createBitbucket(CreateBitbucketRequest request) {
  82. call(
  83. new PostRequest(path("create_bitbucket"))
  84. .setParam("key", request.getKey())
  85. .setParam("url", request.getUrl())
  86. .setParam("personalAccessToken", request.getPersonalAccessToken())
  87. .setMediaType(MediaTypes.JSON)).content();
  88. }
  89. /**
  90. * This is a POST request.
  91. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/create_github">Further information about this action online (including a response example)</a>
  92. * @since 8.1
  93. */
  94. public void createGithub(CreateGithubRequest request) {
  95. call(
  96. new PostRequest(path("create_github"))
  97. .setParam("appId", request.getAppId())
  98. .setParam("key", request.getKey())
  99. .setParam("privateKey", request.getPrivateKey())
  100. .setParam("url", request.getUrl())
  101. .setMediaType(MediaTypes.JSON)).content();
  102. }
  103. /**
  104. *
  105. * This is a POST request.
  106. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/delete">Further information about this action online (including a response example)</a>
  107. * @since 8.1
  108. */
  109. public void delete(DeleteRequest request) {
  110. call(
  111. new PostRequest(path("delete"))
  112. .setParam("key", request.getKey())
  113. .setMediaType(MediaTypes.JSON)).content();
  114. }
  115. /**
  116. * This is a POST request.
  117. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/delete_binding">Further information about this action online (including a response example)</a>
  118. * @since 8.1
  119. */
  120. public void deleteBinding(DeleteBindingRequest request) {
  121. call(
  122. new PostRequest(path("delete_binding"))
  123. .setParam("project", request.getProject())
  124. .setMediaType(MediaTypes.JSON)).content();
  125. }
  126. /**
  127. * This is a GET request.
  128. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/get_binding">Further information about this action online (including a response example)</a>
  129. * @since 8.1
  130. */
  131. public AlmSettings.GetBindingWsResponse getBinding(GetBindingRequest request) {
  132. return call(
  133. new GetRequest(path("get_binding"))
  134. .setParam("project", request.getProject())
  135. .setMediaType(MediaTypes.JSON),
  136. AlmSettings.GetBindingWsResponse.parser());
  137. }
  138. /**
  139. * This is a GET request.
  140. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/list">Further information about this action online (including a response example)</a>
  141. * @since 8.1
  142. */
  143. public AlmSettings.ListWsResponse list(ListRequest request) {
  144. return call(
  145. new GetRequest(path("list"))
  146. .setParam("project", request.getProject())
  147. .setMediaType(MediaTypes.JSON),
  148. AlmSettings.ListWsResponse.parser());
  149. }
  150. /**
  151. *
  152. * This is a GET request.
  153. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/list_definitions">Further information about this action online (including a response example)</a>
  154. * @since 8.1
  155. */
  156. public AlmSettings.ListDefinitionsWsResponse listDefinitions() {
  157. return call(
  158. new GetRequest(path("list_definitions")),
  159. AlmSettings.ListDefinitionsWsResponse.parser());
  160. }
  161. /**
  162. * This is a POST request.
  163. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/set_azure_binding">Further information about this action online (including a response example)</a>
  164. * @since 8.1
  165. */
  166. public void setAzureBinding(SetAzureBindingRequest request) {
  167. call(
  168. new PostRequest(path("set_azure_binding"))
  169. .setParam("almSetting", request.getAlmSetting())
  170. .setParam("project", request.getProject())
  171. .setMediaType(MediaTypes.JSON)).content();
  172. }
  173. /**
  174. * This is a POST request.
  175. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/set_gitlab_binding">Further information about this action online (including a response example)</a>
  176. * @since 8.1
  177. */
  178. public void setGitlabBinding(SetGitlabBindingRequest request) {
  179. call(
  180. new PostRequest(path("set_gitlab_binding"))
  181. .setParam("almSetting", request.getAlmSetting())
  182. .setParam("project", request.getProject())
  183. .setParam("repository", request.getRepository())
  184. .setMediaType(MediaTypes.JSON)).content();
  185. }
  186. /**
  187. * This is a POST request.
  188. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/set_bitbucket_binding">Further information about this action online (including a response example)</a>
  189. * @since 8.1
  190. */
  191. public void setBitbucketBinding(SetBitbucketBindingRequest request) {
  192. call(
  193. new PostRequest(path("set_bitbucket_binding"))
  194. .setParam("almSetting", request.getAlmSetting())
  195. .setParam("project", request.getProject())
  196. .setParam("repository", request.getRepositoryKey())
  197. .setParam("slug", request.getRepositorySlug())
  198. .setMediaType(MediaTypes.JSON)).content();
  199. }
  200. /**
  201. * This is a POST request.
  202. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/set_github_binding">Further information about this action online (including a response example)</a>
  203. * @since 8.1
  204. */
  205. public void setGithubBinding(SetGithubBindingRequest request) {
  206. call(
  207. new PostRequest(path("set_github_binding"))
  208. .setParam("almSetting", request.getAlmSetting())
  209. .setParam("project", request.getProject())
  210. .setParam("repository", request.getRepository())
  211. .setParam("summaryCommentEnabled", request.getSummaryCommentEnabled())
  212. .setMediaType(MediaTypes.JSON)).content();
  213. }
  214. /**
  215. *
  216. * This is a POST request.
  217. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/update_azure">Further information about this action online (including a response example)</a>
  218. * @since 8.1
  219. */
  220. public void updateAzure(UpdateAzureRequest request) {
  221. call(
  222. new PostRequest(path("update_azure"))
  223. .setParam("key", request.getKey())
  224. .setParam("newKey", request.getNewKey())
  225. .setParam("personalAccessToken", request.getPersonalAccessToken())
  226. .setMediaType(MediaTypes.JSON)).content();
  227. }
  228. /**
  229. *
  230. * This is a POST request.
  231. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/update_gitlab">Further information about this action online (including a response example)</a>
  232. * @since 8.1
  233. */
  234. public void updateGitlab(UpdateGitlabRequest request) {
  235. call(
  236. new PostRequest(path("update_gitlab"))
  237. .setParam("key", request.getKey())
  238. .setParam("newKey", request.getNewKey())
  239. .setParam("personalAccessToken", request.getPersonalAccessToken())
  240. .setMediaType(MediaTypes.JSON)).content();
  241. }
  242. /**
  243. *
  244. * This is a POST request.
  245. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/update_bitbucket">Further information about this action online (including a response example)</a>
  246. * @since 8.1
  247. */
  248. public void updateBitbucket(UpdateBitbucketRequest request) {
  249. call(
  250. new PostRequest(path("update_bitbucket"))
  251. .setParam("key", request.getKey())
  252. .setParam("newKey", request.getNewKey())
  253. .setParam("url", request.getUrl())
  254. .setParam("personalAccessToken", request.getPersonalAccessToken())
  255. .setMediaType(MediaTypes.JSON)).content();
  256. }
  257. /**
  258. *
  259. * This is a POST request.
  260. * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_settings/update_github">Further information about this action online (including a response example)</a>
  261. * @since 8.1
  262. */
  263. public void updateGithub(UpdateGithubRequest request) {
  264. call(
  265. new PostRequest(path("update_github"))
  266. .setParam("appId", request.getAppId())
  267. .setParam("key", request.getKey())
  268. .setParam("newKey", request.getNewKey())
  269. .setParam("privateKey", request.getPrivateKey())
  270. .setParam("url", request.getUrl())
  271. .setMediaType(MediaTypes.JSON)).content();
  272. }
  273. }