diff options
author | Daniel Schwarz <daniel.schwarz@sonarsource.com> | 2017-03-02 12:21:09 +0100 |
---|---|---|
committer | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2017-03-23 17:38:34 +0100 |
commit | 26acbcc8e99e13e893858bc6117cecdb378799cd (patch) | |
tree | 9c9fa96efa2c697e296d9e194125a107d8f4dd52 /sonar-ws/src/main | |
parent | 8ee4fc27140cb87ecabe63b319788787cc071bd2 (diff) | |
download | sonarqube-26acbcc8e99e13e893858bc6117cecdb378799cd.tar.gz sonarqube-26acbcc8e99e13e893858bc6117cecdb378799cd.zip |
SONAR-8857 create quality profiles for specific organizations
Diffstat (limited to 'sonar-ws/src/main')
-rw-r--r-- | sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java | 13 | ||||
-rw-r--r-- | sonar-ws/src/main/protobuf/ws-qualityprofiles.proto | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java index f7d3b1936bc..85319cb1c35 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofile/CreateRequest.java @@ -29,10 +29,12 @@ public class CreateRequest { private final String profileName; private final String language; + private final String organizationKey; private CreateRequest(Builder builder) { this.profileName = builder.profileName; this.language = builder.language; + this.organizationKey = builder.organizationKey; } public String getLanguage() { @@ -43,6 +45,10 @@ public class CreateRequest { return profileName; } + public String getOrganizationKey() { + return organizationKey; + } + public static Builder builder() { return new Builder(); } @@ -50,6 +56,7 @@ public class CreateRequest { public static class Builder { private String language; private String profileName; + private String organizationKey; private Builder() { // enforce factory method use @@ -65,9 +72,15 @@ public class CreateRequest { return this; } + public Builder setOrganizationKey(@Nullable String organizationKey) { + this.organizationKey = organizationKey; + return this; + } + public CreateRequest build() { checkArgument(language != null && !language.isEmpty(), "Language is mandatory and must not be empty."); checkArgument(profileName != null && !profileName.isEmpty(), "Profile name is mandatory and must not be empty."); + checkArgument(organizationKey == null || !organizationKey.isEmpty(), "Organization key may be either null or not empty. Empty organization key is invalid."); return new CreateRequest(this); } } diff --git a/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto b/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto index 2c85b0e4682..fa8c312be2b 100644 --- a/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto +++ b/sonar-ws/src/main/protobuf/ws-qualityprofiles.proto @@ -43,6 +43,7 @@ message SearchWsResponse { optional string rulesUpdatedAt = 11; optional string lastUsed = 13; optional string userUpdatedAt = 14; + optional string organization = 15; } } @@ -59,6 +60,7 @@ message CreateWsResponse { optional bool isDefault = 6; optional Infos infos = 7; optional Warnings warnings = 8; + optional string organization = 9; message Infos { repeated string infos = 1; |