@@ -2119,7 +2119,7 @@ public GroupAccessToken createGroupAccessToken(Object groupIdOrPath, String name
21192119 GitLabApiForm formData = new GitLabApiForm ()
21202120 .withParam ("name" , name , true )
21212121 .withParam ("scopes" , Arrays .asList (scopes ))
2122- .withParam ("expires_at" , expiresAt )
2122+ .withParam ("expires_at" , ISO8601 . dateOnly ( expiresAt ) )
21232123 .withParam ("access_level" , accessLevel );
21242124
21252125 Response response = post (Response .Status .CREATED , formData , "groups" , getGroupIdOrPath (groupIdOrPath ), "access_tokens" );
@@ -2137,10 +2137,30 @@ public GroupAccessToken createGroupAccessToken(Object groupIdOrPath, String name
21372137 * @throws GitLabApiException if any exception occurs
21382138 */
21392139 public GroupAccessToken rotateGroupAccessToken (Object groupIdOrPath , Long tokenId ) throws GitLabApiException {
2140- Response response = post (Response .Status .OK , (Form )null , "groups" , getGroupIdOrPath (groupIdOrPath ), "access_tokens" , tokenId , "rotate" );
2140+ return rotateGroupAccessToken (groupIdOrPath , tokenId , null );
2141+ }
2142+
2143+
2144+ /**
2145+ * Rotate a group access token. Revokes the previous token and creates a new token that expires in one week.
2146+ *
2147+ * <pre><code>GitLab Endpoint: POST /groups/:id/access_tokens/:token_id/rotate</code></pre>
2148+ *
2149+ * @param groupIdOrPath the group in the form of an Long(ID), String(path), or Group instance
2150+ * @param tokenId ID of the group access token
2151+ * @param expiresAt Expiration date of the access token
2152+ * @return the updated GroupAccessToken instance
2153+ * @throws GitLabApiException if any exception occurs
2154+ */
2155+ public GroupAccessToken rotateGroupAccessToken (Object groupIdOrPath , Long tokenId , Date expiresAt ) throws GitLabApiException {
2156+ GitLabApiForm formData = new GitLabApiForm ()
2157+ .withParam ("expires_at" , ISO8601 .dateOnly (expiresAt ));
2158+
2159+ Response response = post (Response .Status .OK , formData , "groups" , getGroupIdOrPath (groupIdOrPath ), "access_tokens" , tokenId , "rotate" );
21412160 return (response .readEntity (GroupAccessToken .class ));
21422161 }
21432162
2163+
21442164 /**
21452165 * Revoke a group access token.
21462166 *
0 commit comments