Module: Gitlab::Client::Epics

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

Overview

Defines methods related to Epics.

Instance Method Summary collapse

Instance Method Details

#create_epic(group_id, title, options = {}) ⇒ Gitlab::ObjectifiedHash

Creates a new epic.

Examples:

Gitlab.create_epic(123, "My new epic title")

Parameters:

  • group_id (Integer)

    The ID of a group.

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

    A customizable set of options.

Returns:

 44 45 46 47
# File 'lib/gitlab/client/epics.rb', line 44 def create_epic(group_id, title, options = {}) body = options.merge(title: title) post("/groups/#{group_id}/epics", body: body) end

#delete_epic(group_id, epic_iid) ⇒ Object

Deletes an epic.

Examples:

Gitlab.delete_epic(42, 123)

Parameters:

  • group_id (Integer)

    The ID of a group.

  • epic_iid (Integer)

    The IID of an epic.

 55 56 57
# File 'lib/gitlab/client/epics.rb', line 55 def delete_epic(group_id, epic_iid) delete("/groups/#{group_id}/epics/#{epic_iid}") end

#edit_epic(group_id, epic_iid, options = {}) ⇒ Gitlab::ObjectifiedHash

Updates an existing epic.

Examples:

Gitlab.edit_epic(42) Gitlab.edit_epic(42, 123, { title: 'New epic title' })

Parameters:

  • group_id (Integer)

    The ID.

  • epic_iid (Integer)

    The IID of an epic.

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

    A customizable set of options

Returns:

 69 70 71
# File 'lib/gitlab/client/epics.rb', line 69 def edit_epic(group_id, epic_iid, options = {}) put("/groups/#{group_id}/epics/#{epic_iid}", body: options) end

#epic(group_id, epic_iid, options = {}) ⇒ Gitlab::ObjectifiedHash

Gets a single epic.

Examples:

Gitlab.epic(123, 1)

Parameters:

  • group_id (Integer)

    The ID of a group.

  • epic_iid (Integer)

    The ID of a epic.

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

    A customizable set of options.

Returns:

 31 32 33
# File 'lib/gitlab/client/epics.rb', line 31 def epic(group_id, epic_iid, options = {}) get("/groups/#{group_id}/epics/#{epic_iid}", query: options) end

#epics(group_id, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of epics.

Examples:

Gitlab.epics(123) Gitlab.epics(123, { per_page: 40, page: 2 })

Parameters:

  • group_id (Integer)

    The ID 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:

 18 19 20
# File 'lib/gitlab/client/epics.rb', line 18 def epics(group_id, options = {}) get("/groups/#{group_id}/epics", query: options) end