Commit 387b9caf authored by Artem V. Navrotskiy's avatar Artem V. Navrotskiy Committed by Artem V. Navrotskiy

Add API method for get key with user information by ID of an SSH key: getSSHKey

API function was introduced by PR: https://github.com/gitlabhq/gitlabhq/pull/9591
parent ce178d6e
......@@ -279,6 +279,18 @@ public class GitlabAPI {
return Arrays.asList(retrieve().to(tailUrl, GitlabSSHKey[].class));
}
/**
* Get key with user information by ID of an SSH key.
*
* @param keyId The ID of an SSH key
* @return The SSH key with user information
* @throws IOException on gitlab api call error
*/
public GitlabSSHKey getSSHKey(Integer keyId) throws IOException {
String tailUrl = GitlabSSHKey.KEYS_URL + "/" + keyId;
return retrieve().to(tailUrl, GitlabSSHKey.class);
}
/**
* Delete a user
*
......
......@@ -7,6 +7,7 @@ public class GitlabSSHKey {
private Integer _id;
private String _title;
private String _key;
private GitlabUser _user;
public Integer getId() {
return _id;
......@@ -31,4 +32,12 @@ public class GitlabSSHKey {
public void setKey(String key) {
_key = key;
}
public GitlabUser getUser() {
return _user;
}
public void setUser(GitlabUser user) {
_user = user;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment