import org.sonarqube.ws.client.emails.EmailsService;
import org.sonarqube.ws.client.favorites.FavoritesService;
import org.sonarqube.ws.client.governancereports.GovernanceReportsService;
+import org.sonarqube.ws.client.hotspots.HotspotsService;
import org.sonarqube.ws.client.issues.IssuesService;
import org.sonarqube.ws.client.l10n.L10nService;
import org.sonarqube.ws.client.languages.LanguagesService;
private final EmailsService emailsService;
private final FavoritesService favoritesService;
private final GovernanceReportsService governanceReportsService;
+ private final HotspotsService hotspotsService;
private final IssuesService issuesService;
private final L10nService l10nService;
private final LanguagesService languagesService;
this.emailsService = new EmailsService(wsConnector);
this.favoritesService = new FavoritesService(wsConnector);
this.governanceReportsService = new GovernanceReportsService(wsConnector);
+ this.hotspotsService = new HotspotsService(wsConnector);
this.issuesService = new IssuesService(wsConnector);
this.l10nService = new L10nService(wsConnector);
this.languagesService = new LanguagesService(wsConnector);
return governanceReportsService;
}
+ @Override
+ public HotspotsService hotspots() {
+ return hotspotsService;
+ }
+
@Override
public IssuesService issues() {
return issuesService;
import org.sonarqube.ws.client.emails.EmailsService;
import org.sonarqube.ws.client.favorites.FavoritesService;
import org.sonarqube.ws.client.governancereports.GovernanceReportsService;
+import org.sonarqube.ws.client.hotspots.HotspotsService;
import org.sonarqube.ws.client.issues.IssuesService;
import org.sonarqube.ws.client.l10n.L10nService;
import org.sonarqube.ws.client.languages.LanguagesService;
GovernanceReportsService governanceReports();
+ HotspotsService hotspots();
+
IssuesService issues();
L10nService l10n();
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/add_comment">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+@Generated("sonar-ws-generator")
+public class AddCommentRequest {
+
+ private String comment;
+ private String hotspot;
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "This is safe because user input is validated by the calling code"
+ */
+ public AddCommentRequest setComment(String comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "AU-TpxcA-iU5OvuD2FL0"
+ */
+ public AddCommentRequest setHotspot(String hotspot) {
+ this.hotspot = hotspot;
+ return this;
+ }
+
+ public String getHotspot() {
+ return hotspot;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/assign">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+@Generated("sonar-ws-generator")
+public class AssignRequest {
+
+ private String assignee;
+ private String comment;
+ private String hotspot;
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "admin"
+ */
+ public AssignRequest setAssignee(String assignee) {
+ this.assignee = assignee;
+ return this;
+ }
+
+ public String getAssignee() {
+ return assignee;
+ }
+
+ /**
+ * Example value: "Hey Bob! Could you please have a look and confirm my assertion that we are safe here, please"
+ */
+ public AssignRequest setComment(String comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "AU-Tpxb--iU5OvuD2FLy"
+ */
+ public AssignRequest setHotspot(String hotspot) {
+ this.hotspot = hotspot;
+ return this;
+ }
+
+ public String getHotspot() {
+ return hotspot;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/change_status">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+@Generated("sonar-ws-generator")
+public class ChangeStatusRequest {
+
+ private String comment;
+ private String hotspot;
+ private String resolution;
+ private String status;
+
+ /**
+ * Example value: "This is safe because user input is validated by the calling code"
+ */
+ public ChangeStatusRequest setComment(String comment) {
+ this.comment = comment;
+ return this;
+ }
+
+ public String getComment() {
+ return comment;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "AU-TpxcA-iU5OvuD2FL0"
+ */
+ public ChangeStatusRequest setHotspot(String hotspot) {
+ this.hotspot = hotspot;
+ return this;
+ }
+
+ public String getHotspot() {
+ return hotspot;
+ }
+
+ /**
+ * Possible values:
+ * <ul>
+ * <li>"FIXED"</li>
+ * <li>"SAFE"</li>
+ * </ul>
+ */
+ public ChangeStatusRequest setResolution(String resolution) {
+ this.resolution = resolution;
+ return this;
+ }
+
+ public String getResolution() {
+ return resolution;
+ }
+
+ /**
+ * This is a mandatory parameter.
+ * Possible values:
+ * <ul>
+ * <li>"TO_REVIEW"</li>
+ * <li>"REVIEWED"</li>
+ * </ul>
+ */
+ public ChangeStatusRequest setStatus(String status) {
+ this.status = status;
+ return this;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import java.util.stream.Collectors;
+import javax.annotation.Generated;
+import org.sonarqube.ws.Hotspots;
+import org.sonarqube.ws.MediaTypes;
+import org.sonarqube.ws.client.BaseService;
+import org.sonarqube.ws.client.GetRequest;
+import org.sonarqube.ws.client.PostRequest;
+import org.sonarqube.ws.client.WsConnector;
+
+/**
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots">Further information about this web service online</a>
+ */
+@Generated("sonar-ws-generator")
+public class HotspotsService extends BaseService {
+
+ public HotspotsService(WsConnector wsConnector) {
+ super(wsConnector, "api/hotspots");
+ }
+
+ /**
+ *
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/add_comment">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+ public void addComment(AddCommentRequest request) {
+ call(
+ new PostRequest(path("add_comment"))
+ .setParam("comment", request.getComment())
+ .setParam("hotspot", request.getHotspot())
+ .setMediaType(MediaTypes.JSON)).content();
+ }
+
+ /**
+ *
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/assign">Further information about this action online (including a response example)</a>
+ * @since 8.2
+ */
+ public void assign(AssignRequest request) {
+ call(
+ new PostRequest(path("assign"))
+ .setParam("assignee", request.getAssignee())
+ .setParam("comment", request.getComment())
+ .setParam("hotspot", request.getHotspot())
+ .setMediaType(MediaTypes.JSON)).content();
+ }
+
+ /**
+ *
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/change_status">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+ public void changeStatus(ChangeStatusRequest request) {
+ call(
+ new PostRequest(path("change_status"))
+ .setParam("comment", request.getComment())
+ .setParam("hotspot", request.getHotspot())
+ .setParam("resolution", request.getResolution())
+ .setParam("status", request.getStatus())
+ .setMediaType(MediaTypes.JSON)).content();
+ }
+
+ /**
+ *
+ * This is part of the internal API.
+ * This is a GET request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/search">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+ public Hotspots.SearchWsResponse search(SearchRequest request) {
+ return call(
+ new GetRequest(path("search"))
+ .setParam("branch", request.getBranch())
+ .setParam("hotspots", request.getHotspots() == null ? null : request.getHotspots().stream().collect(Collectors.joining(",")))
+ .setParam("onlyMine", request.getOnlyMine())
+ .setParam("p", request.getP())
+ .setParam("projectKey", request.getProjectKey())
+ .setParam("ps", request.getPs())
+ .setParam("pullRequest", request.getPullRequest())
+ .setParam("resolution", request.getResolution())
+ .setParam("sinceLeakPeriod", request.getSinceLeakPeriod())
+ .setParam("status", request.getStatus())
+ .setMediaType(MediaTypes.JSON),
+ Hotspots.SearchWsResponse.parser());
+ }
+
+ /**
+ *
+ * This is part of the internal API.
+ * This is a GET request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/show">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+ public Hotspots.ShowWsResponse show(ShowRequest request) {
+ return call(
+ new GetRequest(path("show"))
+ .setParam("hotspot", request.getHotspot())
+ .setMediaType(MediaTypes.JSON),
+ Hotspots.ShowWsResponse.parser());
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import java.util.List;
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/search">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+@Generated("sonar-ws-generator")
+public class SearchRequest {
+
+ private String branch;
+ private List<String> hotspots;
+ private String onlyMine;
+ private String p;
+ private String projectKey;
+ private String ps;
+ private String pullRequest;
+ private String resolution;
+ private String sinceLeakPeriod;
+ private String status;
+
+ /**
+ * This is part of the internal API.
+ * Example value: "feature/my_branch"
+ */
+ public SearchRequest setBranch(String branch) {
+ this.branch = branch;
+ return this;
+ }
+
+ public String getBranch() {
+ return branch;
+ }
+
+ /**
+ * Example value: "my_project"
+ */
+ public SearchRequest setHotspots(List<String> hotspots) {
+ this.hotspots = hotspots;
+ return this;
+ }
+
+ public List<String> getHotspots() {
+ return hotspots;
+ }
+
+ /**
+ * Possible values:
+ * <ul>
+ * <li>"true"</li>
+ * <li>"false"</li>
+ * <li>"yes"</li>
+ * <li>"no"</li>
+ * </ul>
+ */
+ public SearchRequest setOnlyMine(String onlyMine) {
+ this.onlyMine = onlyMine;
+ return this;
+ }
+
+ public String getOnlyMine() {
+ return onlyMine;
+ }
+
+ /**
+ * Example value: "42"
+ */
+ public SearchRequest setP(String p) {
+ this.p = p;
+ return this;
+ }
+
+ public String getP() {
+ return p;
+ }
+
+ /**
+ * Example value: "my_project"
+ */
+ public SearchRequest setProjectKey(String projectKey) {
+ this.projectKey = projectKey;
+ return this;
+ }
+
+ public String getProjectKey() {
+ return projectKey;
+ }
+
+ /**
+ * Example value: "20"
+ */
+ public SearchRequest setPs(String ps) {
+ this.ps = ps;
+ return this;
+ }
+
+ public String getPs() {
+ return ps;
+ }
+
+ /**
+ * This is part of the internal API.
+ * Example value: "5461"
+ */
+ public SearchRequest setPullRequest(String pullRequest) {
+ this.pullRequest = pullRequest;
+ return this;
+ }
+
+ public String getPullRequest() {
+ return pullRequest;
+ }
+
+ /**
+ * Possible values:
+ * <ul>
+ * <li>"FIXED"</li>
+ * <li>"SAFE"</li>
+ * </ul>
+ */
+ public SearchRequest setResolution(String resolution) {
+ this.resolution = resolution;
+ return this;
+ }
+
+ public String getResolution() {
+ return resolution;
+ }
+
+ /**
+ * Possible values:
+ * <ul>
+ * <li>"true"</li>
+ * <li>"false"</li>
+ * <li>"yes"</li>
+ * <li>"no"</li>
+ * </ul>
+ */
+ public SearchRequest setSinceLeakPeriod(String sinceLeakPeriod) {
+ this.sinceLeakPeriod = sinceLeakPeriod;
+ return this;
+ }
+
+ public String getSinceLeakPeriod() {
+ return sinceLeakPeriod;
+ }
+
+ /**
+ * Possible values:
+ * <ul>
+ * <li>"TO_REVIEW"</li>
+ * <li>"REVIEWED"</li>
+ * </ul>
+ */
+ public SearchRequest setStatus(String status) {
+ this.status = status;
+ return this;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.ws.client.hotspots;
+
+import javax.annotation.Generated;
+
+/**
+ * This is part of the internal API.
+ * This is a POST request.
+ * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/hotspots/show">Further information about this action online (including a response example)</a>
+ * @since 8.1
+ */
+@Generated("sonar-ws-generator")
+public class ShowRequest {
+
+ private String hotspot;
+
+ /**
+ * This is a mandatory parameter.
+ * Example value: "AU-TpxcA-iU5OvuD2FL0"
+ */
+ public ShowRequest setHotspot(String hotspot) {
+ this.hotspot = hotspot;
+ return this;
+ }
+
+ public String getHotspot() {
+ return hotspot;
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2020 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+@ParametersAreNonnullByDefault
+@Generated("sonar-ws-generator")
+package org.sonarqube.ws.client.hotspots;
+
+import javax.annotation.Generated;
+import javax.annotation.ParametersAreNonnullByDefault;