Class MilestonesApi

  • All Implemented Interfaces:
    Constants

    public class MilestonesApi
    extends AbstractApi
    This class implements the client side API for the GitLab milestones calls.
    • Constructor Detail

      • MilestonesApi

        public MilestonesApi​(GitLabApi gitLabApi)
    • Method Detail

      • getGroupMilestones

        public List<Milestone> getGroupMilestones​(Object groupIdOrPath)
                                           throws GitLabApiException
        Get a list of group milestones.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        Returns:
        the milestones associated with the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestones

        public List<Milestone> getGroupMilestones​(Object groupIdOrPath,
                                                  int page,
                                                  int perPage)
                                           throws GitLabApiException
        Get a list of group milestones.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        page - the page number to get
        perPage - how many milestones per page
        Returns:
        the milestones associated with the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestones

        public Pager<Milestone> getGroupMilestones​(Object groupIdOrPath,
                                                   int itemsPerPage)
                                            throws GitLabApiException
        Get a Page of group milestones.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        itemsPerPage - The number of Milestone instances that will be fetched per page
        Returns:
        the milestones associated with the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestonesStream

        public Stream<Milestone> getGroupMilestonesStream​(Object groupIdOrPath)
                                                   throws GitLabApiException
        Get a Stream of group milestones.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        Returns:
        a Stream of the milestones associated with the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestones

        public List<Milestone> getGroupMilestones​(Object groupIdOrPath,
                                                  Constants.MilestoneState state)
                                           throws GitLabApiException
        Get a list of group milestones that have the specified state.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        state - the milestone state
        Returns:
        the milestones associated with the specified group and state
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestones

        public List<Milestone> getGroupMilestones​(Object groupIdOrPath,
                                                  String search)
                                           throws GitLabApiException
        Get a list of group milestones that have match the search string.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        search - the search string
        Returns:
        the milestones associated with the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestones

        public List<Milestone> getGroupMilestones​(Object groupIdOrPath,
                                                  Constants.MilestoneState state,
                                                  String search)
                                           throws GitLabApiException
        Get a list of group milestones that have the specified state and match the search string.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        state - the milestone state
        search - the search string
        Returns:
        the milestones associated with the specified group
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMilestone

        public Milestone getGroupMilestone​(Object groupIdOrPath,
                                           Integer milestoneId)
                                    throws GitLabApiException
        Get the specified group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        milestoneId - the ID of the milestone tp get
        Returns:
        a Milestone instance for the specified IDs
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupIssues

        public List<Issue> getGroupIssues​(Object groupIdOrPath,
                                          Integer milestoneId)
                                   throws GitLabApiException
        Get the list of issues associated with the specified group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        milestoneId - the milestone ID to get the issues for
        Returns:
        a List of Issue for the milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMergeRequest

        public List<MergeRequest> getGroupMergeRequest​(Object groupIdOrPath,
                                                       Integer milestoneId)
                                                throws GitLabApiException
        Get the list of merge requests associated with the specified group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        milestoneId - the milestone ID to get the merge requests for
        Returns:
        a list of merge requests associated with the specified milestone
        Throws:
        GitLabApiException - if any exception occurs
      • createGroupMilestone

        public Milestone createGroupMilestone​(Object groupIdOrPath,
                                              String title,
                                              String description,
                                              Date dueDate,
                                              Date startDate)
                                       throws GitLabApiException
        Create a group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        title - the title for the milestone
        description - the description for the milestone
        dueDate - the due date for the milestone
        startDate - the start date for the milestone
        Returns:
        the created Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • closeGroupMilestone

        public Milestone closeGroupMilestone​(Object groupIdOrPath,
                                             Integer milestoneId)
                                      throws GitLabApiException
        Close a group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        milestoneId - the milestone ID to close
        Returns:
        the closed Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • activateGroupMilestone

        public Milestone activateGroupMilestone​(Object groupIdOrPath,
                                                Integer milestoneId)
                                         throws GitLabApiException
        Activate a group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        milestoneId - the milestone ID to activate
        Returns:
        the activated Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateGroupMilestone

        public Milestone updateGroupMilestone​(Object groupIdOrPath,
                                              Integer milestoneId,
                                              String title,
                                              String description,
                                              Date dueDate,
                                              Date startDate,
                                              Constants.MilestoneState milestoneState)
                                       throws GitLabApiException
        Update the specified group milestone.
        Parameters:
        groupIdOrPath - the group in the form of an Integer(ID), String(path), or Group instance
        milestoneId - the milestone ID to update
        title - the updated title for the milestone
        description - the updated description for the milestone
        dueDate - the updated due date for the milestone
        startDate - the updated start date for the milestone
        milestoneState - the updated milestone state
        Returns:
        the updated Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public List<Milestone> getMilestones​(Object projectIdOrPath)
                                      throws GitLabApiException
        Get a list of project milestones.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public List<Milestone> getMilestones​(Object projectIdOrPath,
                                             int page,
                                             int perPage)
                                      throws GitLabApiException
        Get a list of project milestones.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page number to get
        perPage - how many milestones per page
        Returns:
        the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public Pager<Milestone> getMilestones​(Object projectIdOrPath,
                                              int itemsPerPage)
                                       throws GitLabApiException
        Get a Page of project milestones.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - The number of Milestone instances that will be fetched per page
        Returns:
        the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestonesStream

        public Stream<Milestone> getMilestonesStream​(Object projectIdOrPath)
                                              throws GitLabApiException
        Get a Stream of project milestones.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream of the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public List<Milestone> getMilestones​(Object projectIdOrPath,
                                             Constants.MilestoneState state)
                                      throws GitLabApiException
        Get a list of project milestones that have the specified state.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        state - the milestone state
        Returns:
        the milestones associated with the specified project and state
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public List<Milestone> getMilestones​(Object projectIdOrPath,
                                             String search)
                                      throws GitLabApiException
        Get a list of project milestones that have match the search string.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        search - the search string
        Returns:
        the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public List<Milestone> getMilestones​(Object projectIdOrPath,
                                             Constants.MilestoneState state,
                                             String search)
                                      throws GitLabApiException
        Get a list of project milestones that have the specified state and match the search string.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        state - the milestone state
        search - the search string
        Returns:
        the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestone

        public Milestone getMilestone​(Object projectIdOrPath,
                                      Integer milestoneId)
                               throws GitLabApiException
        Get the specified milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        milestoneId - the ID of the milestone tp get
        Returns:
        a Milestone instance for the specified IDs
        Throws:
        GitLabApiException - if any exception occurs
      • getIssues

        public List<Issue> getIssues​(Object projectIdOrPath,
                                     Integer milestoneId)
                              throws GitLabApiException
        Get the list of issues associated with the specified milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        milestoneId - the milestone ID to get the issues for
        Returns:
        a List of Issue for the milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequest

        public List<MergeRequest> getMergeRequest​(Object projectIdOrPath,
                                                  Integer milestoneId)
                                           throws GitLabApiException
        Get the list of merge requests associated with the specified milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        milestoneId - the milestone ID to get the merge requests for
        Returns:
        a list of merge requests associated with the specified milestone
        Throws:
        GitLabApiException - if any exception occurs
      • createMilestone

        public Milestone createMilestone​(Object projectIdOrPath,
                                         String title,
                                         String description,
                                         Date dueDate,
                                         Date startDate)
                                  throws GitLabApiException
        Create a milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        title - the title for the milestone
        description - the description for the milestone
        dueDate - the due date for the milestone
        startDate - the start date for the milestone
        Returns:
        the created Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • closeMilestone

        public Milestone closeMilestone​(Object projectIdOrPath,
                                        Integer milestoneId)
                                 throws GitLabApiException
        Close a milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        milestoneId - the milestone ID to close
        Returns:
        the closed Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • activateMilestone

        public Milestone activateMilestone​(Object projectIdOrPath,
                                           Integer milestoneId)
                                    throws GitLabApiException
        Activate a milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        milestoneId - the milestone ID to activate
        Returns:
        the activated Milestone instance
        Throws:
        GitLabApiException - if any exception occurs
      • updateMilestone

        public Milestone updateMilestone​(Object projectIdOrPath,
                                         Integer milestoneId,
                                         String title,
                                         String description,
                                         Date dueDate,
                                         Date startDate,
                                         Constants.MilestoneState milestoneState)
                                  throws GitLabApiException
        Update the specified milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        milestoneId - the milestone ID to update
        title - the updated title for the milestone
        description - the updated description for the milestone
        dueDate - the updated due date for the milestone
        startDate - the updated start date for the milestone
        milestoneState - the updated milestone state
        Returns:
        the updated Milestone instance
        Throws:
        GitLabApiException - if any exception occurs