From b12e93617de7e80dcb848c6b2cf7a011e11a288c Mon Sep 17 00:00:00 2001 From: Matteo Mara Date: Thu, 30 Jun 2022 17:55:56 +0200 Subject: SONAR-16567 update API api/user_tokens/search for returning the expiration date --- .../org/sonarqube/ws/client/usertokens/GenerateRequest.java | 10 ++++++++++ .../org/sonarqube/ws/client/usertokens/UserTokensService.java | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'sonar-ws/src/main/java') diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java index c0b3214b7d8..f2e2b5de0c3 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/GenerateRequest.java @@ -35,6 +35,7 @@ public class GenerateRequest { private String name; private String type; private String projectKey; + private String expirationDate; /** * Example value: "g.hopper" @@ -78,4 +79,13 @@ public class GenerateRequest { this.projectKey = projectKey; return this; } + + public String getExpirationDate() { + return expirationDate; + } + + public GenerateRequest setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } } diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java index 1539acc65f2..afe2f57fe16 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/usertokens/UserTokensService.java @@ -51,7 +51,8 @@ public class UserTokensService extends BaseService { .setParam("login", request.getLogin()) .setParam("name", request.getName()) .setParam("type", request.getType()) - .setParam("projectKey", request.getProjectKey()), + .setParam("projectKey", request.getProjectKey()) + .setParam("expirationDate", request.getExpirationDate()), GenerateWsResponse.parser()); } -- cgit v1.2.3