|
|
@@ -165,6 +165,28 @@ public class SeecoderGitlabClient implements SeecoderGitlabApi{
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String getUserEmail(int userId) throws SeecoderGitlabException {
|
|
|
+ try {
|
|
|
+ ObjectMapper objectMapper = new ObjectMapper();
|
|
|
+ Request.Builder builder = new Request.Builder()
|
|
|
+ .addHeader("Authorization", token);
|
|
|
+ builder = builder
|
|
|
+ .url(host + "/api/user/"+userId+"/email")
|
|
|
+ .get();
|
|
|
+ Request request = builder.build();
|
|
|
+ final Call call = client.newCall(request);
|
|
|
+ Response response = call.execute();
|
|
|
+ return processResponse(objectMapper, response, new TypeReference<String>() {});
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
+ logger.error("JSON writeValueAsString error", e);
|
|
|
+ throw SeecoderGitlabException.JSON_ERROR;
|
|
|
+ } catch (IOException e) {
|
|
|
+ logger.error("IOException", e);
|
|
|
+ throw SeecoderGitlabException.IO_ERROR;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public GitlabGroup createGroup(String groupName) throws SeecoderGitlabException {
|
|
|
try {
|