@@ -1046,6 +1046,23 @@ public ImpersonationToken createPersonalAccessToken(
1046
1046
userIdOrUsername , name , description , expiresAt , scopes , false );
1047
1047
}
1048
1048
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
+
1049
1066
/**
1050
1067
* Revokes a personal access token. Available only for admin users.
1051
1068
*
@@ -1102,23 +1119,6 @@ private ImpersonationToken createPersonalAccessTokenOrImpersonationToken(
1102
1119
return (response .readEntity (ImpersonationToken .class ));
1103
1120
}
1104
1121
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
-
1122
1122
/**
1123
1123
* Populate the REST form with data from the User instance.
1124
1124
*
0 commit comments