Class GitLabApi


  • public class GitLabApi
    extends Object
    This class is provides a simplified interface to a GitLab API server, and divides the API up into a separate API class for each concern.
    • Field Detail

      • DEFAULT_PER_PAGE

        public static final int DEFAULT_PER_PAGE
        GitLab4J default per page. GitLab will ignore anything over 100.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         Constants.TokenType tokenType,
                         String authToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        tokenType - the type of auth the token is for, PRIVATE or ACCESS
        authToken - the token to use for access to the API
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         String privateToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        privateToken - to private token to use for access to the API
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         Constants.TokenType tokenType,
                         String authToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        tokenType - the type of auth the token is for, PRIVATE or ACCESS
        authToken - the token to use for access to the API
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         String privateToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        privateToken - to private token to use for access to the API
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         Session session)
        Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        session - the Session instance obtained by logining into the GitLab server
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         Session session)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        session - the Session instance obtained by logining into the GitLab server
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         Constants.TokenType tokenType,
                         String authToken,
                         String secretToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        tokenType - the type of auth the token is for, PRIVATE or ACCESS
        authToken - the token to use for access to the API
        secretToken - use this token to validate received payloads
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         String privateToken,
                         String secretToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        privateToken - to private token to use for access to the API
        secretToken - use this token to validate received payloads
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         Constants.TokenType tokenType,
                         String authToken,
                         String secretToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        tokenType - the type of auth the token is for, PRIVATE or ACCESS
        authToken - the token to use for access to the API
        secretToken - use this token to validate received payloads
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         String privateToken,
                         String secretToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        privateToken - to private token to use for access to the API
        secretToken - use this token to validate received payloads
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         String privateToken,
                         String secretToken,
                         Map<String,​Object> clientConfigProperties)
        Constructs a GitLabApi instance set up to interact with the GitLab server specified by GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        privateToken - to private token to use for access to the API
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         Constants.TokenType tokenType,
                         String authToken,
                         String secretToken,
                         Map<String,​Object> clientConfigProperties)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        tokenType - the type of auth the token is for, PRIVATE or ACCESS
        authToken - the token to use for access to the API
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
      • GitLabApi

        public GitLabApi​(String hostUrl,
                         String privateToken,
                         String secretToken,
                         Map<String,​Object> clientConfigProperties)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
        Parameters:
        hostUrl - the URL of the GitLab server
        privateToken - to private token to use for access to the API
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         String hostUrl,
                         Constants.TokenType tokenType,
                         String authToken,
                         String secretToken,
                         Map<String,​Object> clientConfigProperties)
        Constructs a GitLabApi instance set up to interact with the GitLab server specified by GitLab API version.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        hostUrl - the URL of the GitLab server
        tokenType - the type of auth the token is for, PRIVATE or ACCESS
        authToken - to token to use for access to the API
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
    • Method Detail

      • getLogger

        public static final Logger getLogger()
        Get the GitLab4J shared Logger instance.
        Returns:
        the GitLab4J shared Logger instance
      • duplicate

        public final GitLabApi duplicate()
        Create a new GitLabApi instance that is logically a duplicate of this instance, with the exception off sudo state.
        Returns:
        a new GitLabApi instance that is logically a duplicate of this instance, with the exception off sudo state.
      • oauth2Login

        public static GitLabApi oauth2Login​(String url,
                                            String username,
                                            CharSequence password)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - a CharSequence containing the password for a given username
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(String url,
                                            String username,
                                            char[] password)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - a char array holding the password for a given username
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(String url,
                                            String username,
                                            CharSequence password,
                                            boolean ignoreCertificateErrors)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - a CharSequence containing the password for a given username
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(String url,
                                            String username,
                                            char[] password,
                                            boolean ignoreCertificateErrors)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - a char array holding the password for a given username
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(String url,
                                            String username,
                                            CharSequence password,
                                            String secretToken,
                                            Map<String,​Object> clientConfigProperties,
                                            boolean ignoreCertificateErrors)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - a CharSequence containing the password for a given username
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(String url,
                                            String username,
                                            char[] password,
                                            String secretToken,
                                            Map<String,​Object> clientConfigProperties,
                                            boolean ignoreCertificateErrors)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - a char array holding the password for a given username
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(GitLabApi.ApiVersion apiVersion,
                                            String url,
                                            String username,
                                            char[] password,
                                            String secretToken,
                                            Map<String,​Object> clientConfigProperties,
                                            boolean ignoreCertificateErrors)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        apiVersion - the ApiVersion specifying which version of the API to use
        username - user name for which private token should be obtained
        password - a char array holding the password for a given username
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • oauth2Login

        public static GitLabApi oauth2Login​(GitLabApi.ApiVersion apiVersion,
                                            String url,
                                            String username,
                                            CharSequence password,
                                            String secretToken,
                                            Map<String,​Object> clientConfigProperties,
                                            boolean ignoreCertificateErrors)
                                     throws GitLabApiException

        Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.

        Parameters:
        url - GitLab URL
        apiVersion - the ApiVersion specifying which version of the API to use
        username - user name for which private token should be obtained
        password - password for a given username
        secretToken - use this token to validate received payloads
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • login

        @Deprecated
        public static GitLabApi login​(GitLabApi.ApiVersion apiVersion,
                                      String url,
                                      String username,
                                      String password)
                               throws GitLabApiException
        Deprecated.
        As of release 4.8.7, will be removed in 4.9.0

        Logs into GitLab using provided username and password, and creates a new GitLabApi instance using returned private token and the specified GitLab API version.

        NOTE: For GitLab servers 10.2 and above this will utilize OAUTH2 for login. For GitLab servers prior to 10.2, the Session API login is utilized.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        url - GitLab URL
        username - user name for which private token should be obtained
        password - password for a given username
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • login

        @Deprecated
        public static GitLabApi login​(String url,
                                      String username,
                                      String password)
                               throws GitLabApiException
        Deprecated.
        As of release 4.8.7, will be removed in 4.9.0

        Logs into GitLab using provided username and password, and creates a new GitLabApi instance using returned private token using GitLab API version 4.

        NOTE: For GitLab servers 10.2 and above this will utilize OAUTH2 for login. For GitLab servers prior to 10.2, the Session API login is utilized.
        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - password for a given username
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • login

        @Deprecated
        public static GitLabApi login​(GitLabApi.ApiVersion apiVersion,
                                      String url,
                                      String username,
                                      String password,
                                      boolean ignoreCertificateErrors)
                               throws GitLabApiException
        Deprecated.
        As of release 4.8.7, will be removed in 4.9.0

        Logs into GitLab using provided username and password, and creates a new GitLabApi instance using returned private token and the specified GitLab API version.

        NOTE: For GitLab servers 10.2 and above this will utilize OAUTH2 for login. For GitLab servers prior to 10.2, the Session API login is utilized.
        Parameters:
        apiVersion - the ApiVersion specifying which version of the API to use
        url - GitLab URL
        username - user name for which private token should be obtained
        password - password for a given username
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • login

        @Deprecated
        public static GitLabApi login​(String url,
                                      String username,
                                      String password,
                                      boolean ignoreCertificateErrors)
                               throws GitLabApiException
        Deprecated.
        As of release 4.8.7, will be removed in 4.9.0

        Logs into GitLab using provided username and password, and creates a new GitLabApi instance using returned private token using GitLab API version 4.

        NOTE: For GitLab servers 10.2 and above this will utilize OAUTH2 for login. For GitLab servers prior to 10.2, the Session API login is utilized.
        Parameters:
        url - GitLab URL
        username - user name for which private token should be obtained
        password - password for a given username
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
        Returns:
        new GitLabApi instance configured for a user-specific token
        Throws:
        GitLabApiException - GitLabApiException if any exception occurs during execution
      • getSession

        @Deprecated
        public Session getSession()
        Deprecated.
        This method will be removed in Release 4.9.0

        If this instance was created with login(String, String, String) this method will return the Session instance returned by the GitLab API on login, otherwise returns null.

        NOTE: For GitLab servers 10.2 and above this method will always return null.
        Returns:
        the Session instance
      • withRequestResponseLogging

        public GitLabApi withRequestResponseLogging()
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance and Level.FINE as the level.
        Returns:
        this GitLabApi instance
      • withRequestResponseLogging

        public GitLabApi withRequestResponseLogging​(Level level)
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
        Parameters:
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        Returns:
        this GitLabApi instance
      • withRequestResponseLogging

        public GitLabApi withRequestResponseLogging​(Logger logger,
                                                    Level level)
        Enable the logging of the requests to and the responses from the GitLab server API.
        Parameters:
        logger - the Logger instance to log to
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        Returns:
        this GitLabApi instance
      • enableRequestResponseLogging

        public void enableRequestResponseLogging()
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance and Level.FINE as the level.
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Level level)
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance. Logging will NOT include entity logging and will mask PRIVATE-TOKEN and Authorization headers.
        Parameters:
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Logger logger,
                                                 Level level)
        Enable the logging of the requests to and the responses from the GitLab server API using the specified logger. Logging will NOT include entity logging and will mask PRIVATE-TOKEN and Authorization headers..
        Parameters:
        logger - the Logger instance to log to
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Level level,
                                                 int maxEntitySize)
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance. Logging will mask PRIVATE-TOKEN and Authorization headers.
        Parameters:
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        maxEntitySize - maximum number of entity bytes to be logged. When logging if the maxEntitySize is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Logger logger,
                                                 Level level,
                                                 int maxEntitySize)
        Enable the logging of the requests to and the responses from the GitLab server API using the specified logger. Logging will mask PRIVATE-TOKEN and Authorization headers.
        Parameters:
        logger - the Logger instance to log to
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        maxEntitySize - maximum number of entity bytes to be logged. When logging if the maxEntitySize is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Level level,
                                                 List<String> maskedHeaderNames)
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
        Parameters:
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        maskedHeaderNames - a list of header names that should have the values masked
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Logger logger,
                                                 Level level,
                                                 List<String> maskedHeaderNames)
        Enable the logging of the requests to and the responses from the GitLab server API using the specified logger.
        Parameters:
        logger - the Logger instance to log to
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        maskedHeaderNames - a list of header names that should have the values masked
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Level level,
                                                 int maxEntitySize,
                                                 List<String> maskedHeaderNames)
        Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
        Parameters:
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        maxEntitySize - maximum number of entity bytes to be logged. When logging if the maxEntitySize is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
        maskedHeaderNames - a list of header names that should have the values masked
      • enableRequestResponseLogging

        public void enableRequestResponseLogging​(Logger logger,
                                                 Level level,
                                                 int maxEntitySize,
                                                 List<String> maskedHeaderNames)
        Enable the logging of the requests to and the responses from the GitLab server API using the specified logger.
        Parameters:
        logger - the Logger instance to log to
        level - the logging level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
        maxEntitySize - maximum number of entity bytes to be logged. When logging if the maxEntitySize is reached, the entity logging will be truncated at maxEntitySize and "...more..." will be added at the end of the log entry. If maxEntitySize is <= 0, entity logging will be disabled
        maskedHeaderNames - a list of header names that should have the values masked
      • sudo

        public void sudo​(String sudoAsUsername)
                  throws GitLabApiException
        Sets up all future calls to the GitLab API to be done as another user specified by sudoAsUsername. To revert back to normal non-sudo operation you must call unsudo(), or pass null as the username.
        Parameters:
        sudoAsUsername - the username to sudo as, null will turn off sudo
        Throws:
        GitLabApiException - if any exception occurs
      • unsudo

        public void unsudo()
        Turns off the currently configured sudo as ID.
      • setSudoAsId

        public void setSudoAsId​(Integer sudoAsId)
                         throws GitLabApiException
        Sets up all future calls to the GitLab API to be done as another user specified by provided user ID. To revert back to normal non-sudo operation you must call unsudo(), or pass null as the sudoAsId.
        Parameters:
        sudoAsId - the ID of the user to sudo as, null will turn off sudo
        Throws:
        GitLabApiException - if any exception occurs
      • getSudoAsId

        public Integer getSudoAsId()
        Get the current sudo as ID, will return null if not in sudo mode.
        Returns:
        the current sudo as ID, will return null if not in sudo mode
      • getAuthToken

        public String getAuthToken()
        Get the auth token being used by this client.
        Returns:
        the auth token being used by this client
      • getSecretToken

        public String getSecretToken()
        Get the secret token.
        Returns:
        the secret token
      • getTokenType

        public Constants.TokenType getTokenType()
        Get the TokenType this client is using.
        Returns:
        the TokenType this client is using
      • getApiVersion

        public GitLabApi.ApiVersion getApiVersion()
        Return the GitLab API version that this instance is using.
        Returns:
        the GitLab API version that this instance is using
      • getGitLabServerUrl

        public String getGitLabServerUrl()
        Get the URL to the GitLab server.
        Returns:
        the URL to the GitLab server
      • getDefaultPerPage

        public int getDefaultPerPage()
        Get the default number per page for calls that return multiple items.
        Returns:
        the default number per page for calls that return multiple item
      • setDefaultPerPage

        public void setDefaultPerPage​(int defaultPerPage)
        Set the default number per page for calls that return multiple items.
        Parameters:
        defaultPerPage - the new default number per page for calls that return multiple item
      • getIgnoreCertificateErrors

        public boolean getIgnoreCertificateErrors()
        Returns true if the API is setup to ignore SSL certificate errors, otherwise returns false.
        Returns:
        true if the API is setup to ignore SSL certificate errors, otherwise returns false
      • setIgnoreCertificateErrors

        public void setIgnoreCertificateErrors​(boolean ignoreCertificateErrors)
        Sets up the Jersey system ignore SSL certificate errors or not.
        Parameters:
        ignoreCertificateErrors - if true will set up the Jersey system ignore SSL certificate errors
      • getVersion

        public Version getVersion()
                           throws GitLabApiException
        Get the version info for the GitLab server using the GitLab Version API.
        Returns:
        the version info for the GitLab server
        Throws:
        GitLabApiException - if any exception occurs
      • getApplicationsApi

        public ApplicationsApi getApplicationsApi()
        Gets the ApplicationsApi instance owned by this GitLabApi instance. The ApplicationsApi is used to perform all OAUTH application related API calls.
        Returns:
        the ApplicationsApi instance owned by this GitLabApi instance
      • getApplicationSettingsApi

        public ApplicationSettingsApi getApplicationSettingsApi()
        Gets the ApplicationSettingsApi instance owned by this GitLabApi instance. The ApplicationSettingsApi is used to perform all application settingsrelated API calls.
        Returns:
        the ApplicationsApi instance owned by this GitLabApi instance
      • getAwardEmojiApi

        public AwardEmojiApi getAwardEmojiApi()
        Gets the AwardEmojiApi instance owned by this GitLabApi instance. The AwardEmojiApi is used to perform all award emoji related API calls.
        Returns:
        the AwardEmojiApi instance owned by this GitLabApi instance
      • getBoardsApi

        public BoardsApi getBoardsApi()
        Gets the BoardsApi instance owned by this GitLabApi instance. The BoardsApi is used to perform all Issue Boards related API calls.
        Returns:
        the BoardsApi instance owned by this GitLabApi instance
      • getCommitsApi

        public CommitsApi getCommitsApi()
        Gets the CommitsApi instance owned by this GitLabApi instance. The CommitsApi is used to perform all commit related API calls.
        Returns:
        the CommitsApi instance owned by this GitLabApi instance
      • getContainerRegistryApi

        public ContainerRegistryApi getContainerRegistryApi()
        Gets the ContainerRegistryApi instance owned by this GitLabApi instance. The ContainerRegistryApi is used to perform all Docker Registry related API calls.
        Returns:
        the ContainerRegistryApi instance owned by this GitLabApi instance
      • getDeployKeysApi

        public DeployKeysApi getDeployKeysApi()
        Gets the DeployKeysApi instance owned by this GitLabApi instance. The DeployKeysApi is used to perform all deploy key related API calls.
        Returns:
        the DeployKeysApi instance owned by this GitLabApi instance
      • getDiscussionsApi

        public DiscussionsApi getDiscussionsApi()
        Gets the DiscussionsApi instance owned by this GitLabApi instance. The DiscussionsApi is used to perform all discussion related API calls.
        Returns:
        the DiscussionsApi instance owned by this GitLabApi instance
      • getEpicsApi

        public EpicsApi getEpicsApi()
        Gets the EpicsApi instance owned by this GitLabApi instance. The EpicsApi is used to perform all Epics and Epic Issues related API calls.
        Returns:
        the EpicsApi instance owned by this GitLabApi instance
      • getEventsApi

        public EventsApi getEventsApi()
        Gets the EventsApi instance owned by this GitLabApi instance. The EventsApi is used to perform all events related API calls.
        Returns:
        the EventsApi instance owned by this GitLabApi instance
      • getGroupApi

        public GroupApi getGroupApi()
        Gets the GroupApi instance owned by this GitLabApi instance. The GroupApi is used to perform all group related API calls.
        Returns:
        the GroupApi instance owned by this GitLabApi instance
      • getHealthCheckApi

        public HealthCheckApi getHealthCheckApi()
        Gets the HealthCheckApi instance owned by this GitLabApi instance. The HealthCheckApi is used to perform all admin level gitlab health monitoring.
        Returns:
        the HealthCheckApi instance owned by this GitLabApi instance
      • getImportExportApi

        public ImportExportApi getImportExportApi()
        Gets the ImportExportApi instance owned by this GitLabApi instance. The ImportExportApi is used to perform all project import/export related API calls.
        Returns:
        the ImportExportApi instance owned by this GitLabApi instance
      • getIssuesApi

        public IssuesApi getIssuesApi()
        Gets the IssuesApi instance owned by this GitLabApi instance. The IssuesApi is used to perform all issue related API calls.
        Returns:
        the IssuesApi instance owned by this GitLabApi instance
      • getJobApi

        public JobApi getJobApi()
        Gets the JobApi instance owned by this GitLabApi instance. The JobApi is used to perform all jobs related API calls.
        Returns:
        the JobsApi instance owned by this GitLabApi instance
      • getLabelsApi

        public LabelsApi getLabelsApi()
      • getLicensesApi

        public LicensesApi getLicensesApi()
        Gets the LicensesApi instance owned by this GitLabApi instance. The LicensesApi is used to perform all license related API calls.
        Returns:
        the LicensesApi instance owned by this GitLabApi instance
      • getMarkdownApi

        public MarkdownApi getMarkdownApi()
        Gets the MarkdownApi instance owned by this GitLabApi instance. The MarkdownApi is used to perform all markdown related API calls.
        Returns:
        the MarkdownApi instance owned by this GitLabApi instance
      • getMergeRequestApi

        public MergeRequestApi getMergeRequestApi()
        Gets the MergeRequestApi instance owned by this GitLabApi instance. The MergeRequestApi is used to perform all merge request related API calls.
        Returns:
        the MergeRequestApi instance owned by this GitLabApi instance
      • getMilestonesApi

        public MilestonesApi getMilestonesApi()
        Gets the MilsestonesApi instance owned by this GitLabApi instance.
        Returns:
        the MilsestonesApi instance owned by this GitLabApi instance
      • getNamespaceApi

        public NamespaceApi getNamespaceApi()
        Gets the NamespaceApi instance owned by this GitLabApi instance. The NamespaceApi is used to perform all namespace related API calls.
        Returns:
        the NamespaceApi instance owned by this GitLabApi instance
      • getNotesApi

        public NotesApi getNotesApi()
        Gets the NotesApi instance owned by this GitLabApi instance. The NotesApi is used to perform all notes related API calls.
        Returns:
        the NotesApi instance owned by this GitLabApi instance
      • getNotificationSettingsApi

        public NotificationSettingsApi getNotificationSettingsApi()
        Gets the NotesApi instance owned by this GitLabApi instance. The NotesApi is used to perform all notes related API calls.
        Returns:
        the NotesApi instance owned by this GitLabApi instance
      • getPackagesApi

        public PackagesApi getPackagesApi()
        Gets the PackagesApi instance owned by this GitLabApi instance. The PackagesApi is used to perform all Package related API calls.
        Returns:
        the PackagesApi instance owned by this GitLabApi instance
      • getPipelineApi

        public PipelineApi getPipelineApi()
        Gets the PipelineApi instance owned by this GitLabApi instance. The PipelineApi is used to perform all pipeline related API calls.
        Returns:
        the PipelineApi instance owned by this GitLabApi instance
      • getProjectApi

        public ProjectApi getProjectApi()
        Gets the ProjectApi instance owned by this GitLabApi instance. The ProjectApi is used to perform all project related API calls.
        Returns:
        the ProjectApi instance owned by this GitLabApi instance
      • getProtectedBranchesApi

        public ProtectedBranchesApi getProtectedBranchesApi()
        Gets the ProtectedBranchesApi instance owned by this GitLabApi instance. The ProtectedBranchesApi is used to perform all protection related actions on a branch of a project.
        Returns:
        the ProtectedBranchesApi instance owned by this GitLabApi instance
      • getRepositoryApi

        public RepositoryApi getRepositoryApi()
        Gets the RepositoryApi instance owned by this GitLabApi instance. The RepositoryApi is used to perform all repository related API calls.
        Returns:
        the RepositoryApi instance owned by this GitLabApi instance
      • getRepositoryFileApi

        public RepositoryFileApi getRepositoryFileApi()
        Gets the RepositoryFileApi instance owned by this GitLabApi instance. The RepositoryFileApi is used to perform all repository files related API calls.
        Returns:
        the RepositoryFileApi instance owned by this GitLabApi instance
      • getRunnersApi

        public RunnersApi getRunnersApi()
        Gets the RunnersApi instance owned by this GitLabApi instance. The RunnersApi is used to perform all Runner related API calls.
        Returns:
        the RunnerApi instance owned by this GitLabApi instance
      • getServicesApi

        public ServicesApi getServicesApi()
        Gets the ServicesApi instance owned by this GitLabApi instance. The ServicesApi is used to perform all services related API calls.
        Returns:
        the ServicesApi instance owned by this GitLabApi instance
      • getSessionApi

        public SessionApi getSessionApi()
        Gets the SessionApi instance owned by this GitLabApi instance. The SessionApi is used to perform a login to the GitLab API.
        Returns:
        the SessionApi instance owned by this GitLabApi instance
      • getSystemHooksApi

        public SystemHooksApi getSystemHooksApi()
        Gets the SystemHooksApi instance owned by this GitLabApi instance. All methods require administrator authorization.
        Returns:
        the SystemHooksApi instance owned by this GitLabApi instance
      • getTagsApi

        public TagsApi getTagsApi()
        Gets the TagsApi instance owned by this GitLabApi instance. The TagsApi is used to perform all tag and release related API calls.
        Returns:
        the TagsApi instance owned by this GitLabApi instance
      • getUserApi

        public UserApi getUserApi()
        Gets the UserApi instance owned by this GitLabApi instance. The UserApi is used to perform all user related API calls.
        Returns:
        the UserApi instance owned by this GitLabApi instance
      • createOptionalFromException

        protected static final <T> Optional<T> createOptionalFromException​(GitLabApiException glae)
        Create and return an Optional instance associated with a GitLabApiException.
        Type Parameters:
        T - the type of the Optional instance
        Parameters:
        glae - the GitLabApiException that was the result of a call to the GitLab API
        Returns:
        the created Optional instance
      • getOptionalException

        public static final GitLabApiException getOptionalException​(Optional<?> optional)
        Get the exception associated with the provided Optional instance, or null if no exception is associated with the Optional instance.
        Parameters:
        optional - the Optional instance to get the exception for
        Returns:
        the exception associated with the provided Optional instance, or null if no exception is associated with the Optional instance
      • orElseThrow

        public static final <T> T orElseThrow​(Optional<T> optional)
                                       throws GitLabApiException
        Return the Optional instances contained value, if present, otherwise throw the exception that is associated with the Optional instance.
        Type Parameters:
        T - the type for the Optional parameter
        Parameters:
        optional - the Optional instance to get the value for
        Returns:
        the value of the Optional instance if no exception is associated with it
        Throws:
        GitLabApiException - if there was an exception associated with the Optional instance
      • getSnippetApi

        public SnippetsApi getSnippetApi()
        Gets the SnippetsApi instance owned by this GitLabApi instance. The SnippetsApi is used to perform all snippet related API calls.
        Returns:
        the SnippetsApi instance owned by this GitLabApi instance
      • getWikisApi

        public WikisApi getWikisApi()
        Gets the WikisApi instance owned by this GitLabApi instance. The WikisApi is used to perform all wiki related API calls.
        Returns:
        the WikisApi instance owned by this GitLabApi instance