Class LabelsApi

    • Constructor Detail

      • LabelsApi

        public LabelsApi​(GitLabApi gitLabApi)
    • Method Detail

      • getLabels

        public List<Label> getLabels​(Object projectIdOrPath)
                              throws GitLabApiException
        Get all labels of the specified project.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a list of project's labels
        Throws:
        GitLabApiException - if any exception occurs
      • getLabels

        public List<Label> getLabels​(Object projectIdOrPath,
                                     int page,
                                     int perPage)
                              throws GitLabApiException
        Get all labels of the specified project to using the specified page and per page setting
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of items per page
        Returns:
        a list of project's labels in the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getLabels

        public Pager<Label> getLabels​(Object projectIdOrPath,
                                      int itemsPerPage)
                               throws GitLabApiException
        Get a Pager of all labels of the specified project.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of items per page
        Returns:
        a list of project's labels in the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getLabelsStream

        public Stream<Label> getLabelsStream​(Object projectIdOrPath)
                                      throws GitLabApiException
        Get a Stream of all labels of the specified project.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream of project's labels
        Throws:
        GitLabApiException - if any exception occurs
      • createLabel

        public Label createLabel​(Object projectIdOrPath,
                                 String name,
                                 String color,
                                 String description)
                          throws GitLabApiException
        Create a label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        color - the color for the label
        description - the description for the label
        Returns:
        the created Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • createLabel

        public Label createLabel​(Object projectIdOrPath,
                                 String name,
                                 String color)
                          throws GitLabApiException
        Create a label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        color - the color for the label
        Returns:
        the created Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • createLabel

        public Label createLabel​(Object projectIdOrPath,
                                 String name,
                                 String color,
                                 Integer priority)
                          throws GitLabApiException
        Create a label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        color - the color for the label
        priority - the priority for the label
        Returns:
        the created Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • createLabel

        public Label createLabel​(Object projectIdOrPath,
                                 String name,
                                 String color,
                                 String description,
                                 Integer priority)
                          throws GitLabApiException
        Create a label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        color - the color for the label
        description - the description for the label
        priority - the priority for the label
        Returns:
        the created Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateLabelName

        public Label updateLabelName​(Object projectIdOrPath,
                                     String name,
                                     String newName,
                                     String description,
                                     Integer priority)
                              throws GitLabApiException
        Update the specified label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        newName - the new name for the label
        description - the description for the label
        priority - the priority for the label
        Returns:
        the modified Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateLabelColor

        public Label updateLabelColor​(Object projectIdOrPath,
                                      String name,
                                      String color,
                                      String description,
                                      Integer priority)
                               throws GitLabApiException
        Update the specified label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        color - the color for the label
        description - the description for the label
        priority - the priority for the label
        Returns:
        the modified Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateLabel

        public Label updateLabel​(Object projectIdOrPath,
                                 String name,
                                 String newName,
                                 String color,
                                 String description,
                                 Integer priority)
                          throws GitLabApiException
        Update the specified label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        newName - the new name for the label
        color - the color for the label
        description - the description for the label
        priority - the priority for the label
        Returns:
        the modified Label instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteLabel

        public void deleteLabel​(Object projectIdOrPath,
                                String name)
                         throws GitLabApiException
        Delete the specified label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        name - the name for the label
        Throws:
        GitLabApiException - if any exception occurs
      • subscribeLabel

        public Label subscribeLabel​(Object projectIdOrPath,
                                    Integer labelId)
                             throws GitLabApiException
        Subscribe a specified label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        labelId - the label ID
        Returns:
        HttpStatusCode 503
        Throws:
        GitLabApiException - if any exception occurs
      • unsubscribeLabel

        public Label unsubscribeLabel​(Object projectIdOrPath,
                                      Integer labelId)
                               throws GitLabApiException
        Unsubscribe a specified label
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        labelId - the label ID
        Returns:
        HttpStatusCode 503
        Throws:
        GitLabApiException - if any exception occurs