Class MilestonesApi

    • Constructor Detail

      • MilestonesApi

        public MilestonesApi​(GitLabApi gitLabApi)
    • Method Detail

      • getGroupMilestones

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

        public java.util.List<Milestone> getGroupMilestones​(java.lang.Object groupIdOrPath,
                                                            int page,
                                                            int perPage)
                                                     throws GitLabApiException
        Get a list of group milestones.
        GitLab Endpoint: GET /groups/:id/milestones
        Parameters:
        groupIdOrPath - the group in the form of an Long(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​(java.lang.Object groupIdOrPath,
                                                   int itemsPerPage)
                                            throws GitLabApiException
        Get a Page of group milestones.
        GitLab Endpoint: GET /groups/:id/milestones
        Parameters:
        groupIdOrPath - the group in the form of an Long(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 java.util.stream.Stream<Milestone> getGroupMilestonesStream​(java.lang.Object groupIdOrPath)
                                                                    throws GitLabApiException
        Get a Stream of group milestones.
        GitLab Endpoint: GET /groups/:id/milestones
        Parameters:
        groupIdOrPath - the group in the form of an Long(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 java.util.List<Milestone> getGroupMilestones​(java.lang.Object groupIdOrPath,
                                                            Constants.MilestoneState state)
                                                     throws GitLabApiException
        Get a list of group milestones that have the specified state.
        GitLab Endpoint: GET /groups/:id/milestones
        Parameters:
        groupIdOrPath - the group in the form of an Long(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 java.util.List<Milestone> getGroupMilestones​(java.lang.Object groupIdOrPath,
                                                            java.lang.String search)
                                                     throws GitLabApiException
        Get a list of group milestones that have match the search string.
        GitLab Endpoint: GET /groups/:id/milestones
        Parameters:
        groupIdOrPath - the group in the form of an Long(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 java.util.List<Milestone> getGroupMilestones​(java.lang.Object groupIdOrPath,
                                                            Constants.MilestoneState state,
                                                            java.lang.String search)
                                                     throws GitLabApiException
        Get a list of group milestones that have the specified state and match the search string.
        GitLab Endpoint: GET /groups/:id/milestones/:milestone_id
        Parameters:
        groupIdOrPath - the group in the form of an Long(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​(java.lang.Object groupIdOrPath,
                                           java.lang.Long milestoneId)
                                    throws GitLabApiException
        Get the specified group milestone.
        GitLab Endpoint: GET /groups/:id/milestones/:milestone_id
        Parameters:
        groupIdOrPath - the group in the form of an Long(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 java.util.List<Issue> getGroupIssues​(java.lang.Object groupIdOrPath,
                                                    java.lang.Long milestoneId)
                                             throws GitLabApiException
        Get the list of issues associated with the specified group milestone.
        GitLab Endpoint: GET /groups/:id/milestones/:milestone_id/issues
        Parameters:
        groupIdOrPath - the group in the form of an Long(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
      • getGroupIssues

        public Pager<Issue> getGroupIssues​(java.lang.Object groupIdOrPath,
                                           java.lang.Long milestoneId,
                                           int itemsPerPage)
                                    throws GitLabApiException
        Get the Pager of issues associated with the specified group milestone.
        GitLab Endpoint: GET /groups/:id/milestones/:milestone_id/issues
        Parameters:
        groupIdOrPath - the group in the form of an Long(ID), String(path), or Group instance
        milestoneId - the milestone ID to get the issues for
        itemsPerPage - The number of Milestone instances that will be fetched per page
        Returns:
        a Pager of Issue for the milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupIssuesStream

        public java.util.stream.Stream<Issue> getGroupIssuesStream​(java.lang.Object groupIdOrPath,
                                                                   java.lang.Long milestoneId)
                                                            throws GitLabApiException
        Get a Stream of issues associated with the specified group milestone.
        GitLab Endpoint: GET /groups/:id/milestones/:milestone_id/issues
        Parameters:
        groupIdOrPath - the group in the form of an Long(ID), String(path), or Group instance
        milestoneId - the milestone ID to get the issues for
        Returns:
        a Stream of Issue for the milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getGroupMergeRequest

        public java.util.List<MergeRequest> getGroupMergeRequest​(java.lang.Object groupIdOrPath,
                                                                 java.lang.Long milestoneId)
                                                          throws GitLabApiException
        Get the list of merge requests associated with the specified group milestone.
        GitLab Endpoint: GET /groups/:id/milestones/:milestone_id/merge_requests
        Parameters:
        groupIdOrPath - the group in the form of an Long(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​(java.lang.Object groupIdOrPath,
                                              java.lang.String title,
                                              java.lang.String description,
                                              java.util.Date dueDate,
                                              java.util.Date startDate)
                                       throws GitLabApiException
        Create a group milestone.
        GitLab Endpoint: POST /groups/:id/milestones
        Parameters:
        groupIdOrPath - the group in the form of an Long(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​(java.lang.Object groupIdOrPath,
                                             java.lang.Long milestoneId)
                                      throws GitLabApiException
        Close a group milestone.
        GitLab Endpoint: PUT /groups/:id/milestones/:milestone_id
        Parameters:
        groupIdOrPath - the group in the form of an Long(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​(java.lang.Object groupIdOrPath,
                                                java.lang.Long milestoneId)
                                         throws GitLabApiException
        Activate a group milestone.
        GitLab Endpoint: PUT /groups/:id/milestones/:milestone_id
        Parameters:
        groupIdOrPath - the group in the form of an Long(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​(java.lang.Object groupIdOrPath,
                                              java.lang.Long milestoneId,
                                              java.lang.String title,
                                              java.lang.String description,
                                              java.util.Date dueDate,
                                              java.util.Date startDate,
                                              Constants.MilestoneState milestoneState)
                                       throws GitLabApiException
        Update the specified group milestone.
        GitLab Endpoint: PUT /groups/:id/milestones/:milestone_id
        Parameters:
        groupIdOrPath - the group in the form of an Long(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 java.util.List<Milestone> getMilestones​(java.lang.Object projectIdOrPath)
                                                throws GitLabApiException
        Get a list of project milestones.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        Returns:
        the milestones associated with the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMilestones

        public java.util.List<Milestone> getMilestones​(java.lang.Object projectIdOrPath,
                                                       int page,
                                                       int perPage)
                                                throws GitLabApiException
        Get a list of project milestones.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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​(java.lang.Object projectIdOrPath,
                                              int itemsPerPage)
                                       throws GitLabApiException
        Get a Pager of project milestones.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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 java.util.stream.Stream<Milestone> getMilestonesStream​(java.lang.Object projectIdOrPath)
                                                               throws GitLabApiException
        Get a Stream of project milestones.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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 java.util.List<Milestone> getMilestones​(java.lang.Object projectIdOrPath,
                                                       Constants.MilestoneState state)
                                                throws GitLabApiException
        Get a list of project milestones that have the specified state.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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 java.util.List<Milestone> getMilestones​(java.lang.Object projectIdOrPath,
                                                       java.lang.String search)
                                                throws GitLabApiException
        Get a list of project milestones that have match the search string.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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 java.util.List<Milestone> getMilestones​(java.lang.Object projectIdOrPath,
                                                       Constants.MilestoneState state,
                                                       java.lang.String search)
                                                throws GitLabApiException
        Get a list of project milestones that have the specified state and match the search string.
        GitLab Endpoint: GET /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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​(java.lang.Object projectIdOrPath,
                                      java.lang.Long milestoneId)
                               throws GitLabApiException
        Get the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(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 java.util.List<Issue> getIssues​(java.lang.Object projectIdOrPath,
                                               java.lang.Long milestoneId)
                                        throws GitLabApiException
        Get the list of issues associated with the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Long(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
      • getIssues

        public Pager<Issue> getIssues​(java.lang.Object projectIdOrPath,
                                      java.lang.Long milestoneId,
                                      int itemsPerPage)
                               throws GitLabApiException
        Get a Pager of issues associated with the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        milestoneId - the milestone ID to get the issues for
        itemsPerPage - the number of Milestone instances that will be fetched per page
        Returns:
        a Pager of Issue for the milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getIssuesStream

        public java.util.stream.Stream<Issue> getIssuesStream​(java.lang.Object projectIdOrPath,
                                                              java.lang.Long milestoneId)
                                                       throws GitLabApiException
        Get a Stream of issues associated with the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        milestoneId - the milestone ID to get the issues for
        Returns:
        a Stream of Issue for the milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequest

        public java.util.List<MergeRequest> getMergeRequest​(java.lang.Object projectIdOrPath,
                                                            java.lang.Long milestoneId)
                                                     throws GitLabApiException
        Get the list of merge requests associated with the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Long(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
      • getMergeRequest

        public Pager<MergeRequest> getMergeRequest​(java.lang.Object projectIdOrPath,
                                                   java.lang.Long milestoneId,
                                                   int itemsPerPage)
                                            throws GitLabApiException
        Get a Pager of merge requests associated with the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        milestoneId - the milestone ID to get the merge requests for
        Returns:
        a Pager of merge requests associated with the specified milestone
        Throws:
        GitLabApiException - if any exception occurs
      • getMergeRequestStream

        public java.util.stream.Stream<MergeRequest> getMergeRequestStream​(java.lang.Object projectIdOrPath,
                                                                           java.lang.Long milestoneId)
                                                                    throws GitLabApiException
        Get a Stream of merge requests associated with the specified milestone.
        GitLab Endpoint: GET /projects/:id/milestones/:milestone_id/merge_requests
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        milestoneId - the milestone ID to get the merge requests for
        Returns:
        a Stream of merge requests associated with the specified milestone
        Throws:
        GitLabApiException - if any exception occurs
      • createMilestone

        public Milestone createMilestone​(java.lang.Object projectIdOrPath,
                                         java.lang.String title,
                                         java.lang.String description,
                                         java.util.Date dueDate,
                                         java.util.Date startDate)
                                  throws GitLabApiException
        Create a milestone.
        GitLab Endpoint: POST /projects/:id/milestones
        Parameters:
        projectIdOrPath - the project in the form of an Long(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​(java.lang.Object projectIdOrPath,
                                        java.lang.Long milestoneId)
                                 throws GitLabApiException
        Close a milestone.
        GitLab Endpoint: PUT /projects/:id/milestones/:milestone_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(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​(java.lang.Object projectIdOrPath,
                                           java.lang.Long milestoneId)
                                    throws GitLabApiException
        Activate a milestone.
        GitLab Endpoint: PUT /projects/:id/milestones/:milestone_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(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​(java.lang.Object projectIdOrPath,
                                         java.lang.Long milestoneId,
                                         java.lang.String title,
                                         java.lang.String description,
                                         java.util.Date dueDate,
                                         java.util.Date startDate,
                                         Constants.MilestoneState milestoneState)
                                  throws GitLabApiException
        Update the specified milestone.
        GitLab Endpoint: PUT /projects/:id/milestones/:milestone_id
        Parameters:
        projectIdOrPath - the project in the form of an Long(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
      • deleteMilestone

        public void deleteMilestone​(java.lang.Object projectIdOrPath,
                                    java.lang.Long milestoneId)
                             throws GitLabApiException
        Delete a project milestone.
        Parameters:
        projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
        milestoneId - the milestone ID to delete
        Throws:
        GitLabApiException - if any exception occurs