Class LicenseTemplatesApi

  • All Implemented Interfaces:
    org.gitlab4j.models.Constants

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

      • Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants

        org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
    • Field Summary

      • Fields inherited from interface org.gitlab4j.models.Constants

        NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
    • Constructor Detail

      • LicenseTemplatesApi

        public LicenseTemplatesApi​(GitLabApi gitLabApi)
    • Method Detail

      • getLicenseTemplates

        public java.util.List<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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 org.gitlab4j.api.models.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<org.gitlab4j.api.models.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.