Module: Gitlab::Client::Todos

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

Overview

Defines methods related to todos

Instance Method Summary collapse

Instance Method Details

#mark_all_todos_as_donevoid

This method returns an undefined value.

Marks all todos for the current user as done

Examples:

Gitlab.mark_all_todos_as_done

40
41
42
# File 'lib/gitlab/client/todos.rb', line 40

def mark_all_todos_as_done
  post("/todos/mark_as_done")
end

#mark_todo_as_done(id) ⇒ Gitlab::ObjectifiedHash

Marks a single pending todo for the current user as done.

Examples:

Gitlab.mark_todo_as_done(42)

Parameters:

  • id (Integer)

    The ID of the todo.

Returns:


30
31
32
# File 'lib/gitlab/client/todos.rb', line 30

def mark_todo_as_done(id)
  post("/todos/#{id}/mark_as_done")
end

#todos(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of todos.

Examples:

Gitlab.todos
Gitlab.todos({ action: 'assigned' })
Gitlab.todos({ state: 'pending' })

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :action (Integer)

    The action to be filtered. Can be `assigned`, `mentioned`, `build_failed`, `marked`, or `approval_required`.

  • :author_id (Integer)

    The ID of an author

  • :project_id (Integer)

    The ID of a project

  • :state (Integer)

    The state of the todo. Can be either `pending` or `done`

  • :type (Integer)

    The type of a todo. Can be either `Issue` or `MergeRequest`

Returns:


19
20
21
# File 'lib/gitlab/client/todos.rb', line 19

def todos(options={})
  get("/todos", query: options)
end