Class GitLabApi

java.lang.Object
org.gitlab4j.api.GitLabApi
All Implemented Interfaces:
AutoCloseable

public class GitLabApi
extends Object
implements 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.
  • Field Details

    • 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 Details

    • GitLabApi

      public GitLabApi​(String hostUrl, 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​(String hostUrl, String personalAccessToken, 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, String hostUrl, 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, String hostUrl, String personalAccessToken, 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, 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​(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​(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​(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​(GitLabApi.ApiVersion apiVersion, String hostUrl, String personalAccessToken, 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
      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​(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 personalAccessToken, 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
      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​(String hostUrl, String personalAccessToken, 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
      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, 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 Details

    • getLogger

      public static final Logger getLogger()
      Get the GitLab4J shared Logger instance.
      Returns:
      the GitLab4J shared Logger instance
    • 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
    • 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 AutoCloseable
    • setRequestTimeout

      public void setRequestTimeout​(Integer connectTimeout, 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​(Integer connectTimeout, 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​(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​(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 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 String getAuthToken()
      Get the auth token being used by this client.
      Returns:
      the auth token being used by this client
    • setAuthTokenSupplier

      public void setAuthTokenSupplier​(Supplier<String> authTokenSupplier)
      Set auth token supplier for gitlab api client.
      Parameters:
      authTokenSupplier - - supplier which provide actual auth token
    • 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
    • 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
    • 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
    • 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
    • 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
    • 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