Skip to content

Commit da42b18

Browse files
committed
update
1 parent d38d691 commit da42b18

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

gitlab4j-api/src/main/java/org/gitlab4j/api/UserApi.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,23 @@ public ImpersonationToken createPersonalAccessToken(
10461046
userIdOrUsername, name, description, expiresAt, scopes, false);
10471047
}
10481048

1049+
/**
1050+
* Create a personal access token for your account.
1051+
*
1052+
* <pre><code>GitLab Endpoint: POST /user/personal_access_tokens</code></pre>
1053+
*
1054+
* @param name the name of the personal access token, required
1055+
* @param description description of personal access token, optional
1056+
* @param expiresAt the expiration date of the personal access token, optional
1057+
* @param scopes an array of scopes of the personal access token. Only accepts k8s_proxy.
1058+
* @return the created PersonalAccessToken instance
1059+
* @throws GitLabApiException if any exception occurs
1060+
*/
1061+
public ImpersonationToken createPersonalAccessToken(String name, String description, Date expiresAt, Scope[] scopes)
1062+
throws GitLabApiException {
1063+
return createPersonalAccessTokenOrImpersonationToken(null, name, description, expiresAt, scopes, false);
1064+
}
1065+
10491066
/**
10501067
* Revokes a personal access token. Available only for admin users.
10511068
*
@@ -1102,23 +1119,6 @@ private ImpersonationToken createPersonalAccessTokenOrImpersonationToken(
11021119
return (response.readEntity(ImpersonationToken.class));
11031120
}
11041121

1105-
/**
1106-
* Create a personal access token for your account.
1107-
*
1108-
* <pre><code>GitLab Endpoint: POST /users/personal_access_tokens</code></pre>
1109-
*
1110-
* @param name the name of the personal access token, required
1111-
* @param description description of personal access token, optional
1112-
* @param expiresAt the expiration date of the personal access token, optional
1113-
* @param scopes an array of scopes of the personal access token
1114-
* @return the created PersonalAccessToken instance
1115-
* @throws GitLabApiException if any exception occurs
1116-
*/
1117-
public ImpersonationToken createSelfPersonalAccessToken(
1118-
String name, String description, Date expiresAt, Scope[] scopes) throws GitLabApiException {
1119-
return createPersonalAccessTokenOrImpersonationToken(null, name, description, expiresAt, scopes, false);
1120-
}
1121-
11221122
/**
11231123
* Populate the REST form with data from the User instance.
11241124
*

0 commit comments

Comments
 (0)