Class GitLabApi

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class GitLabApi
    extends java.lang.Object
    implements java.lang.AutoCloseable
    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.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  GitLabApi.ApiVersion
      Specifies the version of the GitLab API to communicate with.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_PER_PAGE
      GitLab4J default per page.
    • Constructor Summary

      Constructors 
      Constructor Description
      GitLabApi​(java.lang.String hostUrl, java.lang.String personalAccessToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(java.lang.String hostUrl, java.lang.String personalAccessToken, java.lang.String secretToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(java.lang.String hostUrl, java.lang.String personalAccessToken, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(java.lang.String hostUrl, java.lang.String personalAccessToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(java.lang.String hostUrl, Constants.TokenType tokenType, java.lang.String authToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(java.lang.String hostUrl, Constants.TokenType tokenType, java.lang.String authToken, java.lang.String secretToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(java.lang.String hostUrl, Constants.TokenType tokenType, java.lang.String authToken, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties)
      Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4.
      GitLabApi​(GitLabApi.ApiVersion apiVersion, java.lang.String hostUrl, java.lang.String personalAccessToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
      GitLabApi​(GitLabApi.ApiVersion apiVersion, java.lang.String hostUrl, java.lang.String personalAccessToken, java.lang.String secretToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
      GitLabApi​(GitLabApi.ApiVersion apiVersion, java.lang.String hostUrl, java.lang.String personalAccessToken, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties)
      Constructs a GitLabApi instance set up to interact with the GitLab server specified by GitLab API version.
      GitLabApi​(GitLabApi.ApiVersion apiVersion, java.lang.String hostUrl, Constants.TokenType tokenType, java.lang.String authToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
      GitLabApi​(GitLabApi.ApiVersion apiVersion, java.lang.String hostUrl, Constants.TokenType tokenType, java.lang.String authToken, java.lang.String secretToken)
      Constructs a GitLabApi instance set up to interact with the GitLab server using the specified GitLab API version.
      GitLabApi​(GitLabApi.ApiVersion apiVersion, java.lang.String hostUrl, Constants.TokenType tokenType, java.lang.String authToken, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties)
      Constructs a GitLabApi instance set up to interact with the GitLab server specified by GitLab API version.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close the underlying Client and its associated resources.
      protected static <T> java.util.Optional<T> createOptionalFromException​(GitLabApiException glae)
      Create and return an Optional instance associated with a GitLabApiException.
      GitLabApi duplicate()
      Create a new GitLabApi instance that is logically a duplicate of this instance, with the exception of sudo state.
      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.
      void enableRequestResponseLogging​(java.util.logging.Level level)
      Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
      void enableRequestResponseLogging​(java.util.logging.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.
      void enableRequestResponseLogging​(java.util.logging.Level level, int maxEntitySize, java.util.List<java.lang.String> maskedHeaderNames)
      Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
      void enableRequestResponseLogging​(java.util.logging.Level level, java.util.List<java.lang.String> maskedHeaderNames)
      Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
      void enableRequestResponseLogging​(java.util.logging.Logger logger, java.util.logging.Level level)
      Enable the logging of the requests to and the responses from the GitLab server API using the specified logger.
      void enableRequestResponseLogging​(java.util.logging.Logger logger, java.util.logging.Level level, int maxEntitySize)
      Enable the logging of the requests to and the responses from the GitLab server API using the specified logger.
      void enableRequestResponseLogging​(java.util.logging.Logger logger, java.util.logging.Level level, int maxEntitySize, java.util.List<java.lang.String> maskedHeaderNames)
      Enable the logging of the requests to and the responses from the GitLab server API using the specified logger.
      void enableRequestResponseLogging​(java.util.logging.Logger logger, java.util.logging.Level level, java.util.List<java.lang.String> maskedHeaderNames)
      Enable the logging of the requests to and the responses from the GitLab server API using the specified logger.
      GitLabApi.ApiVersion getApiVersion()
      Return the GitLab API version that this instance is using.
      ApplicationsApi getApplicationsApi()
      Gets the ApplicationsApi instance owned by this GitLabApi instance.
      ApplicationSettingsApi getApplicationSettingsApi()
      Gets the ApplicationSettingsApi instance owned by this GitLabApi instance.
      AuditEventApi getAuditEventApi()
      Gets the AuditEventApi instance owned by this GitLabApi instance.
      java.lang.String getAuthToken()
      Get the auth token being used by this client.
      AwardEmojiApi getAwardEmojiApi()
      Gets the AwardEmojiApi instance owned by this GitLabApi instance.
      BoardsApi getBoardsApi()
      Gets the BoardsApi instance owned by this GitLabApi instance.
      CommitsApi getCommitsApi()
      Gets the CommitsApi instance owned by this GitLabApi instance.
      ContainerRegistryApi getContainerRegistryApi()
      Gets the ContainerRegistryApi instance owned by this GitLabApi instance.
      int getDefaultPerPage()
      Get the default number per page for calls that return multiple items.
      DeployKeysApi getDeployKeysApi()
      Gets the DeployKeysApi instance owned by this GitLabApi instance.
      DeploymentsApi getDeploymentsApi()
      Gets the DeployKeysApi instance owned by this GitLabApi instance.
      DeployTokensApi getDeployTokensApi()
      Gets the DeployTokensApi instance owned by this GitLabApi instance.
      DiscussionsApi getDiscussionsApi()
      Gets the DiscussionsApi instance owned by this GitLabApi instance.
      EnvironmentsApi getEnvironmentsApi()
      Gets the EnvironmentsApi instance owned by this GitLabApi instance.
      EpicsApi getEpicsApi()
      Gets the EpicsApi instance owned by this GitLabApi instance.
      EventsApi getEventsApi()
      Gets the EventsApi instance owned by this GitLabApi instance.
      ExternalStatusCheckApi getExternalStatusCheckApi()
      Gets the ExternalStatusCheckApi instance owned by this GitLabApi instance.
      GitLabCiYamlApi getGitLabCiYamlApi()
      Gets the GitLabCiYamlApi instance owned by this GitLabApi instance.
      java.lang.String getGitLabServerUrl()
      Get the URL to the GitLab server.
      GroupApi getGroupApi()
      Gets the GroupApi instance owned by this GitLabApi instance.
      HealthCheckApi getHealthCheckApi()
      Gets the HealthCheckApi instance owned by this GitLabApi instance.
      boolean getIgnoreCertificateErrors()
      Returns true if the API is setup to ignore SSL certificate errors, otherwise returns false.
      ImportExportApi getImportExportApi()
      Gets the ImportExportApi instance owned by this GitLabApi instance.
      IssuesApi getIssuesApi()
      Gets the IssuesApi instance owned by this GitLabApi instance.
      JobApi getJobApi()
      Gets the JobApi instance owned by this GitLabApi instance.
      KeysApi getKeysAPI()
      Gets the KeysApi instance owned by this GitLabApi instance.
      LabelsApi getLabelsApi()  
      LicenseApi getLicenseApi()
      Gets the LicenseApi instance owned by this GitLabApi instance.
      LicenseTemplatesApi getLicenseTemplatesApi()
      Gets the LicenseTemplatesApi instance owned by this GitLabApi instance.
      static java.util.logging.Logger getLogger()
      Get the GitLab4J shared Logger instance.
      MarkdownApi getMarkdownApi()
      Gets the MarkdownApi instance owned by this GitLabApi instance.
      MergeRequestApi getMergeRequestApi()
      Gets the MergeRequestApi instance owned by this GitLabApi instance.
      MetadataApi getMetadataApi()
      Gets the MetadataApi instance owned by this GitlabApi instance.
      MilestonesApi getMilestonesApi()
      Gets the MilsestonesApi instance owned by this GitLabApi instance.
      NamespaceApi getNamespaceApi()
      Gets the NamespaceApi instance owned by this GitLabApi instance.
      NotesApi getNotesApi()
      Gets the NotesApi instance owned by this GitLabApi instance.
      NotificationSettingsApi getNotificationSettingsApi()
      Gets the NotesApi instance owned by this GitLabApi instance.
      static GitLabApiException getOptionalException​(java.util.Optional<?> optional)
      Get the exception associated with the provided Optional instance, or null if no exception is associated with the Optional instance.
      PackagesApi getPackagesApi()
      Gets the PackagesApi instance owned by this GitLabApi instance.
      PipelineApi getPipelineApi()
      Gets the PipelineApi instance owned by this GitLabApi instance.
      ProjectApi getProjectApi()
      Gets the ProjectApi instance owned by this GitLabApi instance.
      ProtectedBranchesApi getProtectedBranchesApi()
      Gets the ProtectedBranchesApi instance owned by this GitLabApi instance.
      ReleaseLinksApi getReleaseLinksApi()
      Gets the ReleaseLinksApi instance owned by this GitLabApi instance.
      ReleasesApi getReleasesApi()
      Gets the ReleasesApi instance owned by this GitLabApi instance.
      RepositoryApi getRepositoryApi()
      Gets the RepositoryApi instance owned by this GitLabApi instance.
      RepositoryFileApi getRepositoryFileApi()
      Gets the RepositoryFileApi instance owned by this GitLabApi instance.
      ResourceLabelEventsApi getResourceLabelEventsApi()
      Gets the ResourceLabelEventsApi instance owned by this GitLabApi instance.
      ResourceStateEventsApi getResourceStateEventsApi()
      Gets the ResourceStateEventsApi instance owned by this GitLabApi instance.
      RunnersApi getRunnersApi()
      Gets the RunnersApi instance owned by this GitLabApi instance.
      SearchApi getSearchApi()
      Gets the SearchApi instance owned by this GitLabApi instance.
      java.lang.String getSecretToken()
      Get the secret token.
      ServicesApi getServicesApi()
      Gets the ServicesApi instance owned by this GitLabApi instance.
      SnippetsApi getSnippetApi()
      Gets the SnippetsApi instance owned by this GitLabApi instance.
      java.lang.Long getSudoAsId()
      Get the current sudo as ID, will return null if not in sudo mode.
      SystemHooksApi getSystemHooksApi()
      Gets the SystemHooksApi instance owned by this GitLabApi instance.
      TagsApi getTagsApi()
      Gets the TagsApi instance owned by this GitLabApi instance.
      TodosApi getTodosApi()
      Gets the TodosApi instance owned by this GitLabApi instance.
      Constants.TokenType getTokenType()
      Get the TokenType this client is using.
      TopicsApi getTopicsApi()
      Gets the TagsApi instance owned by this GitLabApi instance.
      UserApi getUserApi()
      Gets the UserApi instance owned by this GitLabApi instance.
      Version getVersion()
      Get the version info for the GitLab server using the GitLab Version API.
      WikisApi getWikisApi()
      Gets the WikisApi instance owned by this GitLabApi instance.
      static GitLabApi oauth2Login​(java.lang.String url, java.lang.String username, char[] password)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(java.lang.String url, java.lang.String username, char[] password, boolean ignoreCertificateErrors)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(java.lang.String url, java.lang.String username, char[] password, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties, boolean ignoreCertificateErrors)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(java.lang.String url, java.lang.String username, java.lang.CharSequence password)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(java.lang.String url, java.lang.String username, java.lang.CharSequence password, boolean ignoreCertificateErrors)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(java.lang.String url, java.lang.String username, java.lang.CharSequence password, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties, boolean ignoreCertificateErrors)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(GitLabApi.ApiVersion apiVersion, java.lang.String url, java.lang.String username, char[] password, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties, boolean ignoreCertificateErrors)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static GitLabApi oauth2Login​(GitLabApi.ApiVersion apiVersion, java.lang.String url, java.lang.String username, java.lang.CharSequence password, java.lang.String secretToken, java.util.Map<java.lang.String,​java.lang.Object> clientConfigProperties, boolean ignoreCertificateErrors)
      Logs into GitLab using OAuth2 with the provided username and password, and creates a new GitLabApi instance using returned access token.
      static <T> T orElseThrow​(java.util.Optional<T> optional)
      Return the Optional instances contained value, if present, otherwise throw the exception that is associated with the Optional instance.
      void setAuthTokenSupplier​(java.util.function.Supplier<java.lang.String> authTokenSupplier)
      Set auth token supplier for gitlab api client.
      void setDefaultPerPage​(int defaultPerPage)
      Set the default number per page for calls that return multiple items.
      void setIgnoreCertificateErrors​(boolean ignoreCertificateErrors)
      Sets up the Jersey system ignore SSL certificate errors or not.
      void setRequestTimeout​(java.lang.Integer connectTimeout, java.lang.Integer readTimeout)
      Sets the per request connect and read timeout.
      void setSudoAsId​(java.lang.Long sudoAsId)
      Sets up all future calls to the GitLab API to be done as another user specified by provided user ID.
      void sudo​(java.lang.String sudoAsUsername)
      Sets up all future calls to the GitLab API to be done as another user specified by sudoAsUsername.
      void unsudo()
      Turns off the currently configured sudo as ID.
      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.
      GitLabApi withRequestResponseLogging​(java.util.logging.Level level)
      Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance.
      GitLabApi withRequestResponseLogging​(java.util.logging.Logger logger, java.util.logging.Level level)
      Enable the logging of the requests to and the responses from the GitLab server API.
      GitLabApi withRequestTimeout​(java.lang.Integer connectTimeout, java.lang.Integer readTimeout)
      Fluent method that sets the per request connect and read timeout.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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​(java.lang.String hostUrl,
                         java.lang.String personalAccessToken)
        Constructs a GitLabApi instance set up to interact with the GitLab server using GitLab API version 4. This is the primary way to authenticate with the GitLab REST API.
        Parameters:
        hostUrl - the URL of the GitLab server
        personalAccessToken - the private token to use for access to the API
      • GitLabApi

        public GitLabApi​(java.lang.String hostUrl,
                         java.lang.String personalAccessToken,
                         java.lang.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
        personalAccessToken - the private token to use for access to the API
        secretToken - use this token to validate received payloads
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         java.lang.String hostUrl,
                         java.lang.String personalAccessToken)
        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
        personalAccessToken - the private token to use for access to the API
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         java.lang.String hostUrl,
                         java.lang.String personalAccessToken,
                         java.lang.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
        personalAccessToken - the private token to use for access to the API
        secretToken - use this token to validate received payloads
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         java.lang.String hostUrl,
                         Constants.TokenType tokenType,
                         java.lang.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​(java.lang.String hostUrl,
                         Constants.TokenType tokenType,
                         java.lang.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​(GitLabApi.ApiVersion apiVersion,
                         java.lang.String hostUrl,
                         Constants.TokenType tokenType,
                         java.lang.String authToken,
                         java.lang.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​(java.lang.String hostUrl,
                         Constants.TokenType tokenType,
                         java.lang.String authToken,
                         java.lang.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​(GitLabApi.ApiVersion apiVersion,
                         java.lang.String hostUrl,
                         java.lang.String personalAccessToken,
                         java.lang.String secretToken,
                         java.util.Map<java.lang.String,​java.lang.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
        personalAccessToken - 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​(java.lang.String hostUrl,
                         Constants.TokenType tokenType,
                         java.lang.String authToken,
                         java.lang.String secretToken,
                         java.util.Map<java.lang.String,​java.lang.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​(java.lang.String hostUrl,
                         java.lang.String personalAccessToken,
                         java.lang.String secretToken,
                         java.util.Map<java.lang.String,​java.lang.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
        personalAccessToken - the 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​(java.lang.String hostUrl,
                         java.lang.String personalAccessToken,
                         java.util.Map<java.lang.String,​java.lang.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
        personalAccessToken - the private token to use for access to the API
        clientConfigProperties - Map instance with additional properties for the Jersey client connection
      • GitLabApi

        public GitLabApi​(GitLabApi.ApiVersion apiVersion,
                         java.lang.String hostUrl,
                         Constants.TokenType tokenType,
                         java.lang.String authToken,
                         java.lang.String secretToken,
                         java.util.Map<java.lang.String,​java.lang.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 java.util.logging.Logger getLogger()
        Get the GitLab4J shared Logger instance.
        Returns:
        the GitLab4J shared Logger instance
      • oauth2Login

        public static GitLabApi oauth2Login​(java.lang.String url,
                                            java.lang.String username,
                                            java.lang.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​(java.lang.String url,
                                            java.lang.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​(java.lang.String url,
                                            java.lang.String username,
                                            java.lang.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​(java.lang.String url,
                                            java.lang.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​(java.lang.String url,
                                            java.lang.String username,
                                            java.lang.CharSequence password,
                                            java.lang.String secretToken,
                                            java.util.Map<java.lang.String,​java.lang.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​(java.lang.String url,
                                            java.lang.String username,
                                            char[] password,
                                            java.lang.String secretToken,
                                            java.util.Map<java.lang.String,​java.lang.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,
                                            java.lang.String url,
                                            java.lang.String username,
                                            char[] password,
                                            java.lang.String secretToken,
                                            java.util.Map<java.lang.String,​java.lang.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,
                                            java.lang.String url,
                                            java.lang.String username,
                                            java.lang.CharSequence password,
                                            java.lang.String secretToken,
                                            java.util.Map<java.lang.String,​java.lang.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
      • duplicate

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

        public void close()
        Close the underlying Client and its associated resources.
        Specified by:
        close in interface java.lang.AutoCloseable
      • setRequestTimeout

        public void setRequestTimeout​(java.lang.Integer connectTimeout,
                                      java.lang.Integer readTimeout)
        Sets the per request connect and read timeout.
        Parameters:
        connectTimeout - the per request connect timeout in milliseconds, can be null to use default
        readTimeout - the per request read timeout in milliseconds, can be null to use default
      • withRequestTimeout

        public GitLabApi withRequestTimeout​(java.lang.Integer connectTimeout,
                                            java.lang.Integer readTimeout)
        Fluent method that sets the per request connect and read timeout.
        Parameters:
        connectTimeout - the per request connect timeout in milliseconds, can be null to use default
        readTimeout - the per request read timeout in milliseconds, can be null to use default
        Returns:
        this GitLabApi 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​(java.util.logging.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​(java.util.logging.Logger logger,
                                                    java.util.logging.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​(java.util.logging.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​(java.util.logging.Logger logger,
                                                 java.util.logging.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​(java.util.logging.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​(java.util.logging.Logger logger,
                                                 java.util.logging.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​(java.util.logging.Level level,
                                                 java.util.List<java.lang.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​(java.util.logging.Logger logger,
                                                 java.util.logging.Level level,
                                                 java.util.List<java.lang.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​(java.util.logging.Level level,
                                                 int maxEntitySize,
                                                 java.util.List<java.lang.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​(java.util.logging.Logger logger,
                                                 java.util.logging.Level level,
                                                 int maxEntitySize,
                                                 java.util.List<java.lang.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​(java.lang.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​(java.lang.Long 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 java.lang.Long 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 java.lang.String getAuthToken()
        Get the auth token being used by this client.
        Returns:
        the auth token being used by this client
      • setAuthTokenSupplier

        public void setAuthTokenSupplier​(java.util.function.Supplier<java.lang.String> authTokenSupplier)
        Set auth token supplier for gitlab api client.
        Parameters:
        authTokenSupplier - - supplier which provide actual auth token
      • getSecretToken

        public java.lang.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 java.lang.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
      • getAuditEventApi

        public AuditEventApi getAuditEventApi()
        Gets the AuditEventApi instance owned by this GitLabApi instance. The AuditEventApi is used to perform all instance audit event API calls.
        Returns:
        the AuditEventApi 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
      • getDeploymentsApi

        public DeploymentsApi getDeploymentsApi()
        Gets the DeployKeysApi instance owned by this GitLabApi instance. The DeploymentsApi is used to perform all deployment related API calls.
        Returns:
        the DeploymentsApi instance owned by this GitLabApi instance
      • getDeployTokensApi

        public DeployTokensApi getDeployTokensApi()
        Gets the DeployTokensApi instance owned by this GitLabApi instance. The DeployTokensApi is used to perform all deploy token related API calls.
        Returns:
        the DeployTokensApi 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
      • getEnvironmentsApi

        public EnvironmentsApi getEnvironmentsApi()
        Gets the EnvironmentsApi instance owned by this GitLabApi instance. The EnvironmentsApi is used to perform all environment related API calls.
        Returns:
        the EnvironmentsApi 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
      • getExternalStatusCheckApi

        public ExternalStatusCheckApi getExternalStatusCheckApi()
        Gets the ExternalStatusCheckApi instance owned by this GitLabApi instance. The ExternalStatusCheckApi is used to perform all the external status checks related API calls.
        Returns:
        the ExternalStatusCheckApi instance owned by this GitLabApi instance
      • getGitLabCiYamlApi

        public GitLabCiYamlApi getGitLabCiYamlApi()
        Gets the GitLabCiYamlApi instance owned by this GitLabApi instance. The GitLabCiYamlApi is used to get Gitlab CI YAML templates.
        Returns:
        the GitLabCiYamlApi 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()
      • getLicenseApi

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

        public LicenseTemplatesApi getLicenseTemplatesApi()
        Gets the LicenseTemplatesApi instance owned by this GitLabApi instance. The LicenseTemplatesApi is used to perform all license template related API calls.
        Returns:
        the LicenseTemplatesApi 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
      • getReleaseLinksApi

        public ReleaseLinksApi getReleaseLinksApi()
        Gets the ReleaseLinksApi instance owned by this GitLabApi instance. The ReleaseLinksApi is used to perform all Release Links related API calls.
        Returns:
        the ReleaseLinksApi instance owned by this GitLabApi instance
      • getReleasesApi

        public ReleasesApi getReleasesApi()
        Gets the ReleasesApi instance owned by this GitLabApi instance. The ReleasesApi is used to perform all release related API calls.
        Returns:
        the ReleasesApi 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
      • getResourceLabelEventsApi

        public ResourceLabelEventsApi getResourceLabelEventsApi()
        Gets the ResourceLabelEventsApi instance owned by this GitLabApi instance. The ResourceLabelEventsApi is used to perform all Resource Label Events related API calls.
        Returns:
        the ResourceLabelEventsApi instance owned by this GitLabApi instance
      • getResourceStateEventsApi

        public ResourceStateEventsApi getResourceStateEventsApi()
        Gets the ResourceStateEventsApi instance owned by this GitLabApi instance. The ResourceStateEventsApi is used to perform all Resource State Events related API calls.
        Returns:
        the ResourceStateEventsApi 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
      • getSearchApi

        public SearchApi getSearchApi()
        Gets the SearchApi instance owned by this GitLabApi instance. The SearchApi is used to perform search related API calls.
        Returns:
        the SearchApi 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
      • 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
      • getTopicsApi

        public TopicsApi getTopicsApi()
        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
      • 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
      • getTodosApi

        public TodosApi getTodosApi()
        Gets the TodosApi instance owned by this GitLabApi instance. The TodosApi is used to perform all Todo related API calls.
        Returns:
        the TodosApi 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
      • 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
      • getKeysAPI

        public KeysApi getKeysAPI()
        Gets the KeysApi instance owned by this GitLabApi instance. The KeysApi is used to look up users by their ssh key signatures
        Returns:
        the KeysApi instance owned by this GitLabApi instance
      • getMetadataApi

        public MetadataApi getMetadataApi()
        Gets the MetadataApi instance owned by this GitlabApi instance. The MetadataApi is used to retrieve metadata information for this GitLab instance
        Returns:
        the MetadataApi instance owned by this GitlabApi instance
      • createOptionalFromException

        protected static final <T> java.util.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​(java.util.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​(java.util.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