Class PersonalAccessTokenApi

    • Constructor Detail

      • PersonalAccessTokenApi

        public PersonalAccessTokenApi​(GitLabApi gitLabApi)
    • Method Detail

      • rotatePersonalAccessToken

        public PersonalAccessToken rotatePersonalAccessToken()
                                                      throws GitLabApiException
        Rotates the given personal access token. The token is revoked and a new one which will expire in one week is created to replace it. Only working with GitLab 16.0 and above.
        GitLab Endpoint: POST /personal_access_tokens/self/rotate
        Returns:
        the newly created PersonalAccessToken.
        Throws:
        GitLabApiException - if any exception occurs
      • rotatePersonalAccessToken

        public PersonalAccessToken rotatePersonalAccessToken​(java.util.Date expiresAt)
                                                      throws GitLabApiException
        Rotates the given personal access token. The token is revoked and a new one which will expire in one week is created to replace it. Only working with GitLab 16.0 and above.
        GitLab Endpoint: POST /personal_access_tokens/self/rotate
        Parameters:
        expiresAt - Expiration date of the access token
        Returns:
        the newly created PersonalAccessToken.
        Throws:
        GitLabApiException - if any exception occurs
      • rotatePersonalAccessToken

        public PersonalAccessToken rotatePersonalAccessToken​(java.lang.String id,
                                                             java.util.Date expiresAt)
                                                      throws GitLabApiException
        Rotates the given personal access token. The token is revoked and a new one which will expire in one week is created to replace it. Only working with GitLab 16.0 and above.
        GitLab Endpoint: POST /personal_access_tokens/:id/rotate
        Parameters:
        expiresAt - Expiration date of the access token
        Returns:
        the newly created PersonalAccessToken.
        Throws:
        GitLabApiException - if any exception occurs