Module: Gitlab::Client::GroupMilestones

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/group_milestones.rb

Overview

Defines methods related to group milestones.

Instance Method Summary collapse

Instance Method Details

#create_group_milestone(id, title, options = {}) ⇒ Gitlab::ObjectifiedHash

Creates a new group milestone.

Examples:

Gitlab.create_group_milestone(5, 'v1.0')

Parameters:

  • id (Integer, String)

    The ID or name of a group.

  • title (String)

    The title of a milestone.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :description (String)

    The description of a milestone.

  • :due_date (String)

    The due date of a milestone.

Returns:



44
45
46
47
# File 'lib/gitlab/client/group_milestones.rb', line 44

def create_group_milestone(id, title, options = {})
  body = { title: title }.merge(options)
  post("/groups/#{url_encode id}/milestones", body: body)
end

#edit_group_milestone(id, milestone_id, options = {}) ⇒ Gitlab::ObjectifiedHash

Updates a group milestone.

Examples:

Gitlab.edit_group_milestone(5, 2, { state_event: 'activate' })

Parameters:

  • id (Integer, String)

    The ID or name of a group.

  • milestone_id (Integer)

    The ID of a milestone.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :title (String)

    The title of a milestone.

  • :description (String)

    The description of a milestone.

  • :due_date (String)

    The due date of a milestone.

  • :state_event (String)

    The state of a milestone (‘close’ or ‘activate’).

Returns:



62
63
64
# File 'lib/gitlab/client/group_milestones.rb', line 62

def edit_group_milestone(id, milestone_id, options = {})
  put("/groups/#{url_encode id}/milestones/#{milestone_id}", body: options)
end

#group_milestone(id, milestone_id) ⇒ Gitlab::ObjectifiedHash

Gets a single group milestone.

Examples:

Gitlab.group_milestone(5, 36)

Parameters:

  • id (Integer, String)

    The ID or name of a group.

  • milestone_id (Integer)

    The ID of a milestone.

Returns:



29
30
31
# File 'lib/gitlab/client/group_milestones.rb', line 29

def group_milestone(id, milestone_id)
  get("/groups/#{url_encode id}/milestones/#{milestone_id}")
end

#group_milestone_issues(id, milestone_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets the issues of a given group milestone.

Examples:

Gitlab.group_milestone_issues(5, 2)

Parameters:

  • id (Integer, String)

    The ID or name of a group.

  • milestone_id (Integer, String)

    The ID of a milestone.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:



76
77
78
# File 'lib/gitlab/client/group_milestones.rb', line 76

def group_milestone_issues(id, milestone_id, options = {})
  get("/groups/#{url_encode id}/milestones/#{milestone_id}/issues", query: options)
end

#group_milestone_merge_requests(id, milestone_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets the merge_requests of a given group milestone.

Examples:

Gitlab.group_milestone_merge_requests(5, 2)

Parameters:

  • group (Integer, String)

    The ID or name of a group.

  • milestone_id (Integer, String)

    The ID of a milestone.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:



90
91
92
# File 'lib/gitlab/client/group_milestones.rb', line 90

def group_milestone_merge_requests(id, milestone_id, options = {})
  get("/groups/#{url_encode id}/milestones/#{milestone_id}/merge_requests", query: options)
end

#group_milestones(id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of a group’s milestones.

Examples:

Gitlab.group_milestones(5)

Parameters:

  • id (Integer, String)

    The ID or name of a group.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :page (Integer)

    The page number.

  • :per_page (Integer)

    The number of results per page.

Returns:



17
18
19
# File 'lib/gitlab/client/group_milestones.rb', line 17

def group_milestones(id, options = {})
  get("/groups/#{url_encode id}/milestones", query: options)
end