From d86ae4f57acb6ff57462cafa64f049a0ca8c901b Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Mon, 21 Oct 2019 12:39:03 -0500 Subject: [PATCH] SONAR-11154 Update sonar-ws and fix ITs --- .../qualityprofiles/ActivateRulesRequest.java | 93 ++++++++++++++++++ .../qualityprofiles/AddProjectRequest.java | 33 +------ .../client/qualityprofiles/BackupRequest.java | 17 +--- .../qualityprofiles/ChangeParentRequest.java | 32 +----- .../qualityprofiles/ChangelogRequest.java | 17 +--- .../DeactivateRulesRequest.java | 93 ++++++++++++++++++ .../client/qualityprofiles/DeleteRequest.java | 17 +--- .../client/qualityprofiles/ExportRequest.java | 16 +-- .../qualityprofiles/InheritanceRequest.java | 17 +--- .../QualityprofilesService.java | 97 ++++++++----------- .../qualityprofiles/RemoveProjectRequest.java | 33 +------ .../qualityprofiles/SetDefaultRequest.java | 17 +--- 12 files changed, 244 insertions(+), 238 deletions(-) diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ActivateRulesRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ActivateRulesRequest.java index f130fe750bd..4b1b61e4efd 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ActivateRulesRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ActivateRulesRequest.java @@ -36,16 +36,20 @@ public class ActivateRulesRequest { private String asc; private String availableSince; private String compareToProfile; + private List cwe; private List inheritance; private String isTemplate; private List languages; private String organization; + private List owaspTop10; private String q; private String qprofile; private List repositories; private String ruleKey; private String s; + private List sansTop25; private List severities; + private List sonarsourceSecurity; private List statuses; private List tags; private String targetKey; @@ -134,6 +138,18 @@ public class ActivateRulesRequest { return compareToProfile; } + /** + * Example value: "12,125,unknown" + */ + public ActivateRulesRequest setCwe(List cwe) { + this.cwe = cwe; + return this; + } + + public List getCwe() { + return cwe; + } + /** * Example value: "INHERITED,OVERRIDES" * Possible values: @@ -195,6 +211,30 @@ public class ActivateRulesRequest { return organization; } + /** + * Possible values: + *
    + *
  • "a1"
  • + *
  • "a2"
  • + *
  • "a3"
  • + *
  • "a4"
  • + *
  • "a5"
  • + *
  • "a6"
  • + *
  • "a7"
  • + *
  • "a8"
  • + *
  • "a9"
  • + *
  • "a10"
  • + *
+ */ + public ActivateRulesRequest setOwaspTop10(List owaspTop10) { + this.owaspTop10 = owaspTop10; + return this; + } + + public List getOwaspTop10() { + return owaspTop10; + } + /** * Example value: "xpath" */ @@ -262,6 +302,23 @@ public class ActivateRulesRequest { return s; } + /** + * Possible values: + *
    + *
  • "insecure-interaction"
  • + *
  • "risky-resource"
  • + *
  • "porous-defenses"
  • + *
+ */ + public ActivateRulesRequest setSansTop25(List sansTop25) { + this.sansTop25 = sansTop25; + return this; + } + + public List getSansTop25() { + return sansTop25; + } + /** * Example value: "CRITICAL,BLOCKER" * Possible values: @@ -282,6 +339,41 @@ public class ActivateRulesRequest { return severities; } + /** + * Example value: "sql-injection,command-injection,others" + * Possible values: + *
    + *
  • "sql-injection"
  • + *
  • "command-injection"
  • + *
  • "path-traversal-injection"
  • + *
  • "ldap-injection"
  • + *
  • "xpath-injection"
  • + *
  • "rce"
  • + *
  • "dos"
  • + *
  • "ssrf"
  • + *
  • "csrf"
  • + *
  • "xss"
  • + *
  • "log-injection"
  • + *
  • "http-response-splitting"
  • + *
  • "open-redirect"
  • + *
  • "xxe"
  • + *
  • "object-injection"
  • + *
  • "weak-cryptography"
  • + *
  • "auth"
  • + *
  • "insecure-conf"
  • + *
  • "file-manipulation"
  • + *
  • "others"
  • + *
+ */ + public ActivateRulesRequest setSonarsourceSecurity(List sonarsourceSecurity) { + this.sonarsourceSecurity = sonarsourceSecurity; + return this; + } + + public List getSonarsourceSecurity() { + return sonarsourceSecurity; + } + /** * Example value: "READY" * Possible values: @@ -364,6 +456,7 @@ public class ActivateRulesRequest { *
  • "CODE_SMELL"
  • *
  • "BUG"
  • *
  • "VULNERABILITY"
  • + *
  • "SECURITY_HOTSPOT"
  • * */ public ActivateRulesRequest setTypes(List types) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/AddProjectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/AddProjectRequest.java index c6a9814a6c5..c252c56d330 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/AddProjectRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/AddProjectRequest.java @@ -31,28 +31,13 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class AddProjectRequest { - private String key; private String language; private String organization; private String project; - private String projectUuid; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public AddProjectRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public AddProjectRequest setLanguage(String language) { this.language = language; @@ -77,6 +62,7 @@ public class AddProjectRequest { } /** + * This is a mandatory parameter. * Example value: "my_project" */ public AddProjectRequest setProject(String project) { @@ -89,20 +75,7 @@ public class AddProjectRequest { } /** - * Example value: "AU-TpxcA-iU5OvuD2FL5" - * @deprecated since 6.5 - */ - @Deprecated - public AddProjectRequest setProjectUuid(String projectUuid) { - this.projectUuid = projectUuid; - return this; - } - - public String getProjectUuid() { - return projectUuid; - } - - /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public AddProjectRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/BackupRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/BackupRequest.java index 569bdbcf3a9..14ca89ce822 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/BackupRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/BackupRequest.java @@ -31,26 +31,12 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class BackupRequest { - private String key; private String language; private String organization; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public BackupRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public BackupRequest setLanguage(String language) { this.language = language; @@ -75,6 +61,7 @@ public class BackupRequest { } /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public BackupRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangeParentRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangeParentRequest.java index 547e10c9914..304e009389b 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangeParentRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangeParentRequest.java @@ -31,28 +31,13 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class ChangeParentRequest { - private String key; private String language; private String organization; - private String parentKey; private String parentQualityProfile; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public ChangeParentRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public ChangeParentRequest setLanguage(String language) { this.language = language; @@ -76,20 +61,6 @@ public class ChangeParentRequest { return organization; } - /** - * Example value: "AU-TpxcA-iU5OvuD2FLz" - * @deprecated since 6.6 - */ - @Deprecated - public ChangeParentRequest setParentKey(String parentKey) { - this.parentKey = parentKey; - return this; - } - - public String getParentKey() { - return parentKey; - } - /** * Example value: "Sonar way" */ @@ -103,6 +74,7 @@ public class ChangeParentRequest { } /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public ChangeParentRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangelogRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangelogRequest.java index 99b49ad21e6..52ef9db4be2 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangelogRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ChangelogRequest.java @@ -31,7 +31,6 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class ChangelogRequest { - private String key; private String language; private String organization; private String p; @@ -41,20 +40,7 @@ public class ChangelogRequest { private String to; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public ChangelogRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public ChangelogRequest setLanguage(String language) { this.language = language; @@ -103,6 +89,7 @@ public class ChangelogRequest { } /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public ChangelogRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeactivateRulesRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeactivateRulesRequest.java index a41b79a75b3..7bdb0c5f2e8 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeactivateRulesRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeactivateRulesRequest.java @@ -36,16 +36,20 @@ public class DeactivateRulesRequest { private String asc; private String availableSince; private String compareToProfile; + private List cwe; private List inheritance; private String isTemplate; private List languages; private String organization; + private List owaspTop10; private String q; private String qprofile; private List repositories; private String ruleKey; private String s; + private List sansTop25; private List severities; + private List sonarsourceSecurity; private List statuses; private List tags; private String targetKey; @@ -133,6 +137,18 @@ public class DeactivateRulesRequest { return compareToProfile; } + /** + * Example value: "12,125,unknown" + */ + public DeactivateRulesRequest setCwe(List cwe) { + this.cwe = cwe; + return this; + } + + public List getCwe() { + return cwe; + } + /** * Example value: "INHERITED,OVERRIDES" * Possible values: @@ -194,6 +210,30 @@ public class DeactivateRulesRequest { return organization; } + /** + * Possible values: + *
      + *
    • "a1"
    • + *
    • "a2"
    • + *
    • "a3"
    • + *
    • "a4"
    • + *
    • "a5"
    • + *
    • "a6"
    • + *
    • "a7"
    • + *
    • "a8"
    • + *
    • "a9"
    • + *
    • "a10"
    • + *
    + */ + public DeactivateRulesRequest setOwaspTop10(List owaspTop10) { + this.owaspTop10 = owaspTop10; + return this; + } + + public List getOwaspTop10() { + return owaspTop10; + } + /** * Example value: "xpath" */ @@ -261,6 +301,23 @@ public class DeactivateRulesRequest { return s; } + /** + * Possible values: + *
      + *
    • "insecure-interaction"
    • + *
    • "risky-resource"
    • + *
    • "porous-defenses"
    • + *
    + */ + public DeactivateRulesRequest setSansTop25(List sansTop25) { + this.sansTop25 = sansTop25; + return this; + } + + public List getSansTop25() { + return sansTop25; + } + /** * Example value: "CRITICAL,BLOCKER" * Possible values: @@ -281,6 +338,41 @@ public class DeactivateRulesRequest { return severities; } + /** + * Example value: "sql-injection,command-injection,others" + * Possible values: + *
      + *
    • "sql-injection"
    • + *
    • "command-injection"
    • + *
    • "path-traversal-injection"
    • + *
    • "ldap-injection"
    • + *
    • "xpath-injection"
    • + *
    • "rce"
    • + *
    • "dos"
    • + *
    • "ssrf"
    • + *
    • "csrf"
    • + *
    • "xss"
    • + *
    • "log-injection"
    • + *
    • "http-response-splitting"
    • + *
    • "open-redirect"
    • + *
    • "xxe"
    • + *
    • "object-injection"
    • + *
    • "weak-cryptography"
    • + *
    • "auth"
    • + *
    • "insecure-conf"
    • + *
    • "file-manipulation"
    • + *
    • "others"
    • + *
    + */ + public DeactivateRulesRequest setSonarsourceSecurity(List sonarsourceSecurity) { + this.sonarsourceSecurity = sonarsourceSecurity; + return this; + } + + public List getSonarsourceSecurity() { + return sonarsourceSecurity; + } + /** * Example value: "READY" * Possible values: @@ -344,6 +436,7 @@ public class DeactivateRulesRequest { *
  • "CODE_SMELL"
  • *
  • "BUG"
  • *
  • "VULNERABILITY"
  • + *
  • "SECURITY_HOTSPOT"
  • * */ public DeactivateRulesRequest setTypes(List types) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeleteRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeleteRequest.java index c91d5d917e8..02d369c3482 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeleteRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/DeleteRequest.java @@ -31,26 +31,12 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class DeleteRequest { - private String key; private String language; private String organization; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public DeleteRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public DeleteRequest setLanguage(String language) { this.language = language; @@ -75,6 +61,7 @@ public class DeleteRequest { } /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public DeleteRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ExportRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ExportRequest.java index 7a75cfd7524..1e43092a2a3 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ExportRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/ExportRequest.java @@ -31,26 +31,12 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class ExportRequest { - private String key; private String language; private String organization; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public ExportRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. * Example value: "" */ public ExportRequest setLanguage(String language) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/InheritanceRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/InheritanceRequest.java index a6518c43b68..993c9c024ae 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/InheritanceRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/InheritanceRequest.java @@ -31,26 +31,12 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class InheritanceRequest { - private String key; private String language; private String organization; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public InheritanceRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public InheritanceRequest setLanguage(String language) { this.language = language; @@ -75,6 +61,7 @@ public class InheritanceRequest { } /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public InheritanceRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/QualityprofilesService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/QualityprofilesService.java index ff5a984e67c..0a3f1cce722 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/QualityprofilesService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/QualityprofilesService.java @@ -22,17 +22,17 @@ package org.sonarqube.ws.client.qualityprofiles; import java.util.stream.Collectors; 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.Qualityprofiles; import org.sonarqube.ws.Qualityprofiles.CopyWsResponse; import org.sonarqube.ws.Qualityprofiles.CreateWsResponse; -import org.sonarqube.ws.Qualityprofiles.InheritanceWsResponse; -import org.sonarqube.ws.Qualityprofiles.SearchWsResponse; import org.sonarqube.ws.Qualityprofiles.SearchGroupsResponse; import org.sonarqube.ws.Qualityprofiles.SearchUsersResponse; +import org.sonarqube.ws.Qualityprofiles.SearchWsResponse; import org.sonarqube.ws.Qualityprofiles.ShowResponse; +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 Further information about this web service online @@ -60,7 +60,7 @@ public class QualityprofilesService extends BaseService { .setParam("rule", request.getRule()) .setParam("severity", request.getSeverity()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -78,16 +78,20 @@ public class QualityprofilesService extends BaseService { .setParam("asc", request.getAsc()) .setParam("available_since", request.getAvailableSince()) .setParam("compareToProfile", request.getCompareToProfile()) + .setParam("cwe", request.getCwe() == null ? null : request.getCwe().stream().collect(Collectors.joining(","))) .setParam("inheritance", request.getInheritance() == null ? null : request.getInheritance().stream().collect(Collectors.joining(","))) .setParam("is_template", request.getIsTemplate()) .setParam("languages", request.getLanguages() == null ? null : request.getLanguages().stream().collect(Collectors.joining(","))) .setParam("organization", request.getOrganization()) + .setParam("owaspTop10", request.getOwaspTop10() == null ? null : request.getOwaspTop10().stream().collect(Collectors.joining(","))) .setParam("q", request.getQ()) .setParam("qprofile", request.getQprofile()) .setParam("repositories", request.getRepositories() == null ? null : request.getRepositories().stream().collect(Collectors.joining(","))) .setParam("rule_key", request.getRuleKey()) .setParam("s", request.getS()) + .setParam("sansTop25", request.getSansTop25() == null ? null : request.getSansTop25().stream().collect(Collectors.joining(","))) .setParam("severities", request.getSeverities() == null ? null : request.getSeverities().stream().collect(Collectors.joining(","))) + .setParam("sonarsourceSecurity", request.getSonarsourceSecurity() == null ? null : request.getSonarsourceSecurity().stream().collect(Collectors.joining(","))) .setParam("statuses", request.getStatuses() == null ? null : request.getStatuses().stream().collect(Collectors.joining(","))) .setParam("tags", request.getTags() == null ? null : request.getTags().stream().collect(Collectors.joining(","))) .setParam("targetKey", request.getTargetKey()) @@ -95,7 +99,7 @@ public class QualityprofilesService extends BaseService { .setParam("template_key", request.getTemplateKey()) .setParam("types", request.getTypes() == null ? null : request.getTypes().stream().collect(Collectors.joining(","))) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -113,7 +117,7 @@ public class QualityprofilesService extends BaseService { .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -126,14 +130,12 @@ public class QualityprofilesService extends BaseService { public void addProject(AddProjectRequest request) { call( new PostRequest(path("add_project")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("project", request.getProject()) - .setParam("projectUuid", request.getProjectUuid()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -151,7 +153,7 @@ public class QualityprofilesService extends BaseService { .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -164,12 +166,11 @@ public class QualityprofilesService extends BaseService { public String backup(BackupRequest request) { return call( new GetRequest(path("backup")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -182,14 +183,12 @@ public class QualityprofilesService extends BaseService { public void changeParent(ChangeParentRequest request) { call( new PostRequest(path("change_parent")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) - .setParam("parentKey", request.getParentKey()) .setParam("parentQualityProfile", request.getParentQualityProfile()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -202,7 +201,6 @@ public class QualityprofilesService extends BaseService { public String changelog(ChangelogRequest request) { return call( new GetRequest(path("changelog")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("p", request.getP()) @@ -211,7 +209,7 @@ public class QualityprofilesService extends BaseService { .setParam("since", request.getSince()) .setParam("to", request.getTo()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -227,7 +225,7 @@ public class QualityprofilesService extends BaseService { .setParam("leftKey", request.getLeftKey()) .setParam("rightKey", request.getRightKey()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -274,7 +272,7 @@ public class QualityprofilesService extends BaseService { .setParam("key", request.getKey()) .setParam("rule", request.getRule()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -292,23 +290,27 @@ public class QualityprofilesService extends BaseService { .setParam("asc", request.getAsc()) .setParam("available_since", request.getAvailableSince()) .setParam("compareToProfile", request.getCompareToProfile()) + .setParam("cwe", request.getCwe() == null ? null : request.getCwe().stream().collect(Collectors.joining(","))) .setParam("inheritance", request.getInheritance() == null ? null : request.getInheritance().stream().collect(Collectors.joining(","))) .setParam("is_template", request.getIsTemplate()) .setParam("languages", request.getLanguages() == null ? null : request.getLanguages().stream().collect(Collectors.joining(","))) .setParam("organization", request.getOrganization()) + .setParam("owaspTop10", request.getOwaspTop10() == null ? null : request.getOwaspTop10().stream().collect(Collectors.joining(","))) .setParam("q", request.getQ()) .setParam("qprofile", request.getQprofile()) .setParam("repositories", request.getRepositories() == null ? null : request.getRepositories().stream().collect(Collectors.joining(","))) .setParam("rule_key", request.getRuleKey()) .setParam("s", request.getS()) + .setParam("sansTop25", request.getSansTop25() == null ? null : request.getSansTop25().stream().collect(Collectors.joining(","))) .setParam("severities", request.getSeverities() == null ? null : request.getSeverities().stream().collect(Collectors.joining(","))) + .setParam("sonarsourceSecurity", request.getSonarsourceSecurity() == null ? null : request.getSonarsourceSecurity().stream().collect(Collectors.joining(","))) .setParam("statuses", request.getStatuses() == null ? null : request.getStatuses().stream().collect(Collectors.joining(","))) .setParam("tags", request.getTags() == null ? null : request.getTags().stream().collect(Collectors.joining(","))) .setParam("targetKey", request.getTargetKey()) .setParam("template_key", request.getTemplateKey()) .setParam("types", request.getTypes() == null ? null : request.getTypes().stream().collect(Collectors.joining(","))) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -321,12 +323,11 @@ public class QualityprofilesService extends BaseService { public void delete(DeleteRequest request) { call( new PostRequest(path("delete")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -339,12 +340,11 @@ public class QualityprofilesService extends BaseService { public String export(ExportRequest request) { return call( new GetRequest(path("export")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -358,7 +358,7 @@ public class QualityprofilesService extends BaseService { return call( new GetRequest(path("exporters")) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -372,7 +372,7 @@ public class QualityprofilesService extends BaseService { return call( new GetRequest(path("importers")) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -382,14 +382,13 @@ public class QualityprofilesService extends BaseService { * @see Further information about this action online (including a response example) * @since 5.2 */ - public InheritanceWsResponse inheritance(InheritanceRequest request) { + public Qualityprofiles.InheritanceWsResponse inheritance(InheritanceRequest request) { return call( new GetRequest(path("inheritance")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()), - InheritanceWsResponse.parser()); + Qualityprofiles.InheritanceWsResponse.parser()); } /** @@ -408,7 +407,7 @@ public class QualityprofilesService extends BaseService { .setParam("q", request.getQ()) .setParam("selected", request.getSelected()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -426,7 +425,7 @@ public class QualityprofilesService extends BaseService { .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -439,14 +438,12 @@ public class QualityprofilesService extends BaseService { public void removeProject(RemoveProjectRequest request) { call( new PostRequest(path("remove_project")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("project", request.getProject()) - .setParam("projectUuid", request.getProjectUuid()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -464,7 +461,7 @@ public class QualityprofilesService extends BaseService { .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -480,7 +477,7 @@ public class QualityprofilesService extends BaseService { .setParam("key", request.getKey()) .setParam("name", request.getName()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -496,23 +493,7 @@ public class QualityprofilesService extends BaseService { .setParam("backup", request.getBackup()) .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) - ).content(); - } - - /** - * - * This is part of the internal API. - * This is a POST request. - * @see Further information about this action online (including a response example) - * @since 4.4 - * @deprecated since 6.4 - */ - @Deprecated - public void restoreBuiltIn() { - call( - new PostRequest(path("restore_built_in")) - .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -583,12 +564,11 @@ public class QualityprofilesService extends BaseService { public void setDefault(SetDefaultRequest request) { call( new PostRequest(path("set_default")) - .setParam("key", request.getKey()) .setParam("language", request.getLanguage()) .setParam("organization", request.getOrganization()) .setParam("qualityProfile", request.getQualityProfile()) .setMediaType(MediaTypes.JSON) - ).content(); + ).content(); } /** @@ -597,6 +577,7 @@ public class QualityprofilesService extends BaseService { * This is a GET request. * @see Further information about this action online (including a response example) * @since 6.5 + * @return */ public ShowResponse show(ShowRequest request) { return call( diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/RemoveProjectRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/RemoveProjectRequest.java index 9569845c35c..13f3c8ed2f8 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/RemoveProjectRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/RemoveProjectRequest.java @@ -31,28 +31,13 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class RemoveProjectRequest { - private String key; private String language; private String organization; private String project; - private String projectUuid; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public RemoveProjectRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public RemoveProjectRequest setLanguage(String language) { this.language = language; @@ -77,6 +62,7 @@ public class RemoveProjectRequest { } /** + * This is a mandatory parameter. * Example value: "my_project" */ public RemoveProjectRequest setProject(String project) { @@ -89,20 +75,7 @@ public class RemoveProjectRequest { } /** - * Example value: "AU-TpxcB-iU5OvuD2FL6" - * @deprecated since 6.5 - */ - @Deprecated - public RemoveProjectRequest setProjectUuid(String projectUuid) { - this.projectUuid = projectUuid; - return this; - } - - public String getProjectUuid() { - return projectUuid; - } - - /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public RemoveProjectRequest setQualityProfile(String qualityProfile) { diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/SetDefaultRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/SetDefaultRequest.java index ca0e66fbb0c..c7749cf0323 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/SetDefaultRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/qualityprofiles/SetDefaultRequest.java @@ -31,26 +31,12 @@ import javax.annotation.Generated; @Generated("sonar-ws-generator") public class SetDefaultRequest { - private String key; private String language; private String organization; private String qualityProfile; /** - * Example value: "AU-Tpxb--iU5OvuD2FLy" - * @deprecated since 6.6 - */ - @Deprecated - public SetDefaultRequest setKey(String key) { - this.key = key; - return this; - } - - public String getKey() { - return key; - } - - /** + * This is a mandatory parameter. */ public SetDefaultRequest setLanguage(String language) { this.language = language; @@ -75,6 +61,7 @@ public class SetDefaultRequest { } /** + * This is a mandatory parameter. * Example value: "Sonar way" */ public SetDefaultRequest setQualityProfile(String qualityProfile) { -- 2.39.5