diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2017-11-24 14:00:02 +0100 |
---|---|---|
committer | Daniel Schwarz <bartfastiel@users.noreply.github.com> | 2017-11-29 20:24:11 +0100 |
commit | 12f9e1c990deb948912f4da725b0e8c49cdac163 (patch) | |
tree | 4d212a23c401d17af32c2794f2b6d4793f5b53a3 /sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches | |
parent | 10fe82e5c55f29460d1a3a46f6f32215af68a3f8 (diff) | |
download | sonarqube-12f9e1c990deb948912f4da725b0e8c49cdac163.tar.gz sonarqube-12f9e1c990deb948912f4da725b0e8c49cdac163.zip |
Merge sonar-ws-generated into sonar-ws
Diffstat (limited to 'sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches')
5 files changed, 298 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/DeleteRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/DeleteRequest.java new file mode 100644 index 00000000000..6a11d73ecc4 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/DeleteRequest.java @@ -0,0 +1,67 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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.projectbranches; + +import javax.annotation.Generated; + +/** + * Delete a non-main branch of a project.<br/>Requires 'Administer' rights on the specified project. + * + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/delete">Further information about this action online (including a response example)</a> + * @since 6.6 + */ +@Generated("sonar-ws-generator") +public class DeleteRequest { + + private String branch; + private String project; + + /** + * Name of the branch + * + * This is a mandatory parameter. + * Example value: "branch1" + */ + public DeleteRequest setBranch(String branch) { + this.branch = branch; + return this; + } + + public String getBranch() { + return branch; + } + + /** + * Project key + * + * This is a mandatory parameter. + * Example value: "my_project" + */ + public DeleteRequest setProject(String project) { + this.project = project; + return this; + } + + public String getProject() { + return project; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ListRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ListRequest.java new file mode 100644 index 00000000000..d090fe3541a --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ListRequest.java @@ -0,0 +1,51 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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.projectbranches; + +import javax.annotation.Generated; + +/** + * List the branches of a project.<br/>Requires 'Administer' rights on the specified project. + * + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/list">Further information about this action online (including a response example)</a> + * @since 6.6 + */ +@Generated("sonar-ws-generator") +public class ListRequest { + + private String project; + + /** + * Project key + * + * This is a mandatory parameter. + * Example value: "my_project" + */ + public ListRequest setProject(String project) { + this.project = project; + return this; + } + + public String getProject() { + return project; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java new file mode 100644 index 00000000000..65d7ba82530 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/ProjectBranchesService.java @@ -0,0 +1,89 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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.projectbranches; + +import javax.annotation.Generated; +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; +import org.sonarqube.ws.ProjectBranches.ListWsResponse; + +/** + * Manage branch (only available when the Branch plugin is installed) + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches">Further information about this web service online</a> + */ +@Generated("sonar-ws-generator") +public class ProjectBranchesService extends BaseService { + + public ProjectBranchesService(WsConnector wsConnector) { + super(wsConnector, "api/project_branches"); + } + + /** + * Delete a non-main branch of a project.<br/>Requires 'Administer' rights on the specified project. + * + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/delete">Further information about this action online (including a response example)</a> + * @since 6.6 + */ + public String delete(DeleteRequest request) { + return call( + new PostRequest(path("delete")) + .setParam("branch", request.getBranch()) + .setParam("project", request.getProject()) + .setMediaType(MediaTypes.JSON) + ).content(); + } + + /** + * List the branches of a project.<br/>Requires 'Administer' rights on the specified project. + * + * This is part of the internal API. + * This is a GET request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/list">Further information about this action online (including a response example)</a> + * @since 6.6 + */ + public ListWsResponse list(ListRequest request) { + return call( + new GetRequest(path("list")) + .setParam("project", request.getProject()), + ListWsResponse.parser()); + } + + /** + * Rename the main branch of a project.<br/>Requires 'Administer' permission on the specified project. + * + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/rename">Further information about this action online (including a response example)</a> + * @since 6.6 + */ + public void rename(RenameRequest request) { + call( + new PostRequest(path("rename")) + .setParam("name", request.getName()) + .setParam("project", request.getProject()) + .setMediaType(MediaTypes.JSON) + ).content(); + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/RenameRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/RenameRequest.java new file mode 100644 index 00000000000..5fcae6747cf --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/RenameRequest.java @@ -0,0 +1,67 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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.projectbranches; + +import javax.annotation.Generated; + +/** + * Rename the main branch of a project.<br/>Requires 'Administer' permission on the specified project. + * + * This is part of the internal API. + * This is a POST request. + * @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/project_branches/rename">Further information about this action online (including a response example)</a> + * @since 6.6 + */ +@Generated("sonar-ws-generator") +public class RenameRequest { + + private String name; + private String project; + + /** + * New name of the main branch + * + * This is a mandatory parameter. + * Example value: "branch1" + */ + public RenameRequest setName(String name) { + this.name = name; + return this; + } + + public String getName() { + return name; + } + + /** + * Project key + * + * This is a mandatory parameter. + * Example value: "my_project" + */ + public RenameRequest setProject(String project) { + this.project = project; + return this; + } + + public String getProject() { + return project; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/package-info.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/package-info.java new file mode 100644 index 00000000000..148ff98162a --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectbranches/package-info.java @@ -0,0 +1,24 @@ +/* + * SonarQube + * Copyright (C) 2009-2017 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 +package org.sonarqube.ws.client.projectbranches; + +import javax.annotation.ParametersAreNonnullByDefault; + |