diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-07-26 17:21:33 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-07-28 17:31:14 +0200 |
commit | 1d702b6b507bd7c346381cf371d16fd8c556b99e (patch) | |
tree | 85d9a4a21dee50a8410477ea5eeb52157808737f /sonar-ws | |
parent | fa27bf616fad3cb743994ea8407feabd96a22ae9 (diff) | |
download | sonarqube-1d702b6b507bd7c346381cf371d16fd8c556b99e.tar.gz sonarqube-1d702b6b507bd7c346381cf371d16fd8c556b99e.zip |
SONAR-7926 Create WS to add project link
Diffstat (limited to 'sonar-ws')
3 files changed, 75 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/CreateWsRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/CreateWsRequest.java new file mode 100644 index 00000000000..6d41e08e7a7 --- /dev/null +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/CreateWsRequest.java @@ -0,0 +1,68 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact 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.projectlinks; + +import javax.annotation.CheckForNull; +import javax.annotation.Nullable; + +public class CreateWsRequest { + private String projectId; + private String projectKey; + private String name; + private String url; + + @CheckForNull + public String getProjectId() { + return projectId; + } + + public CreateWsRequest setProjectId(@Nullable String projectId) { + this.projectId = projectId; + return this; + } + + @CheckForNull + public String getProjectKey() { + return projectKey; + } + + public CreateWsRequest setProjectKey(@Nullable String projectKey) { + this.projectKey = projectKey; + return this; + } + + public String getName() { + return name; + } + + public CreateWsRequest setName(String name) { + this.name = name; + return this; + } + + public String getUrl() { + return url; + } + + public CreateWsRequest setUrl(String url) { + this.url = url; + return this; + } +} diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java index ea43c3fc466..2ae04134401 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/projectlinks/ProjectLinksWsParameters.java @@ -23,10 +23,13 @@ public class ProjectLinksWsParameters { //actions public static final String ACTION_SEARCH = "search"; + public static final String ACTION_CREATE = "create"; // parameters public static final String PARAM_PROJECT_ID = "projectId"; public static final String PARAM_PROJECT_KEY = "projectKey"; + public static final String PARAM_NAME = "name"; + public static final String PARAM_URL = "url"; private ProjectLinksWsParameters() { // static utility class diff --git a/sonar-ws/src/main/protobuf/ws-projectlink.proto b/sonar-ws/src/main/protobuf/ws-projectlink.proto index 32e1d59d725..073b3e498b0 100644 --- a/sonar-ws/src/main/protobuf/ws-projectlink.proto +++ b/sonar-ws/src/main/protobuf/ws-projectlink.proto @@ -11,6 +11,10 @@ message SearchWsResponse { repeated Link links = 1; } +message CreateWsResponse { + optional Link link = 1; +} + message Link { optional string id = 1; optional string name = 2; |