Class LicenseTemplatesApi

  • All Implemented Interfaces:
    Constants

    public class LicenseTemplatesApi
    extends AbstractApi
    This class provides an entry point to all the GitLab API licenses calls.
    See Also:
    Licenses API
    • Constructor Detail

      • LicenseTemplatesApi

        public LicenseTemplatesApi​(GitLabApi gitLabApi)
    • Method Detail

      • getLicenseTemplates

        public java.util.List<LicenseTemplate> getLicenseTemplates()
                                                            throws GitLabApiException
        Get a List of all license templates.
        GitLab Endpoint: GET /templates/licenses
        Returns:
        a List of LicenseTemplate instances
        Throws:
        GitLabApiException - if any exception occurs
      • getLicenseTemplatesStream

        public java.util.stream.Stream<LicenseTemplate> getLicenseTemplatesStream()
                                                                           throws GitLabApiException
        Get a Stream of all license templates.
        GitLab Endpoint: GET /templates/licenses
        Returns:
        a Stream of LicenseTemplate instances
        Throws:
        GitLabApiException - if any exception occurs
      • getLicenseTemplates

        public Pager<LicenseTemplate> getLicenseTemplates​(int itemsPerPage)
                                                   throws GitLabApiException
        Get a Pager of all license templates.
        GitLab Endpoint: GET /templates/licenses
        Parameters:
        itemsPerPage - the number of LicenseTemplate instances that will be fetched per page
        Returns:
        a Pager of LicenseTemplate instances
        Throws:
        GitLabApiException - if any exception occurs
      • getPopularLicenseTemplates

        public java.util.List<LicenseTemplate> getPopularLicenseTemplates()
                                                                   throws GitLabApiException
        Get a List of popular license templates.
        GitLab Endpoint: GET /templates/licenses?popular=true
        Returns:
        a List of popular LicenseTemplate instances
        Throws:
        GitLabApiException - if any exception occurs
      • getPopularLicenseTemplatesStream

        public java.util.stream.Stream<LicenseTemplate> getPopularLicenseTemplatesStream()
                                                                                  throws GitLabApiException
        Get a Stream of popular license templates.
        GitLab Endpoint: GET /templates/licenses?popular=true
        Returns:
        a Stream of popular LicenseTemplate instances
        Throws:
        GitLabApiException - if any exception occurs
      • getLicenseTemplates

        public Pager<LicenseTemplate> getLicenseTemplates​(java.lang.Boolean popular,
                                                          int itemsPerPage)
                                                   throws GitLabApiException
        Get a Pager of license templates.
        GitLab Endpoint: GET /templates/licenses
        Parameters:
        popular - if true, returns only popular licenses.
        itemsPerPage - the number of LicenseTemplate instances that will be fetched per page
        Returns:
        a Pager of LicenseTemplate instances
        Throws:
        GitLabApiException - if any exception occurs
      • getLicenseTemplate

        public LicenseTemplate getLicenseTemplate​(java.lang.String key)
                                           throws GitLabApiException
        Get a single license template.
        GitLab Endpoint: GET /templates/licenses/:key
        Parameters:
        key - The key of the license template
        Returns:
        a LicenseTemplate instance
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalLicenseTemplate

        public java.util.Optional<LicenseTemplate> getOptionalLicenseTemplate​(java.lang.String key)
        Get a single license template as the value of an Optional.
        GitLab Endpoint: GET /templates/licenses/:key
        Parameters:
        key - The key of the license template
        Returns:
        a single license template as the value of an Optional.