Class MilestonesApi

java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.MilestonesApi
All Implemented Interfaces:
Constants

public class MilestonesApi extends AbstractApi
This class implements the client side API for the GitLab milestones calls.
See Also:
  • Constructor Details

    • MilestonesApi

      public MilestonesApi(GitLabApi gitLabApi)
  • Method Details

    • getGroupMilestones

      public List<Milestone> getGroupMilestones(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 List<Milestone> getGroupMilestones(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(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 Stream<Milestone> getGroupMilestonesStream(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 List<Milestone> getGroupMilestones(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 List<Milestone> getGroupMilestones(Object groupIdOrPath, 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 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.
      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(Object groupIdOrPath, 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 List<Issue> getGroupIssues(Object groupIdOrPath, 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(Object groupIdOrPath, 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 Stream<Issue> getGroupIssuesStream(Object groupIdOrPath, 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 List<MergeRequest> getGroupMergeRequest(Object groupIdOrPath, 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(Object groupIdOrPath, String title, String description, Date dueDate, 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(Object groupIdOrPath, 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(Object groupIdOrPath, 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(Object groupIdOrPath, Long milestoneId, String title, String description, Date dueDate, 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 List<Milestone> getMilestones(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 List<Milestone> getMilestones(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(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 Stream<Milestone> getMilestonesStream(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 List<Milestone> getMilestones(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 List<Milestone> getMilestones(Object projectIdOrPath, 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 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.
      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(Object projectIdOrPath, 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 List<Issue> getIssues(Object projectIdOrPath, 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(Object projectIdOrPath, 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 Stream<Issue> getIssuesStream(Object projectIdOrPath, 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 List<MergeRequest> getMergeRequest(Object projectIdOrPath, 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
    • createMilestone

      public Milestone createMilestone(Object projectIdOrPath, String title, String description, Date dueDate, 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(Object projectIdOrPath, 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(Object projectIdOrPath, 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(Object projectIdOrPath, Long milestoneId, String title, String description, Date dueDate, 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(Object projectIdOrPath, 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