module Gitlab::Client::Notes

Defines methods related to notes. @see docs.gitlab.com/ce/api/notes.html

Public Instance Methods

create_issue_note(project, issue, body) click to toggle source

Creates a new issue note.

@example

Gitlab.create_issue_note(6, 1, 'Adding a note to my issue.')

@param [Integer] project The ID of a project. @param [Integer] issue The ID of an issue. @param [String] body The body of a note. @return [Gitlab::ObjectifiedHash] Information about created note.

# File lib/gitlab/client/notes.rb, line 132
def create_issue_note(project, issue, body)
  post("/projects/#{project}/issues/#{issue}/notes", body: { body: body })
end
create_merge_request_note(project, merge_request, body) click to toggle source

Creates a new note for a single merge request.

@example

Gitlab.create_merge_request_note(5, 3, 'This MR is ready for review.')

@param [Integer] project The ID of a project. @param [Integer] merge_request The ID of a merge request. @param [String] body The content of a note.

# File lib/gitlab/client/notes.rb, line 157
def create_merge_request_note(project, merge_request, body)
  post("/projects/#{project}/merge_requests/#{merge_request}/notes", body: { body: body })
end
create_note(project, body) click to toggle source

Creates a new wall note.

@example

Gitlab.create_note(5, 'This is a wall note!')

@param [Integer] project The ID of a project. @param [String] body The body of a note. @return [Gitlab::ObjectifiedHash] Information about created note.

# File lib/gitlab/client/notes.rb, line 119
def create_note(project, body)
  post("/projects/#{project}/notes", body: { body: body })
end
create_snippet_note(project, snippet, body) click to toggle source

Creates a new snippet note.

@example

Gitlab.create_snippet_note(3, 2, 'Look at this awesome snippet!')

@param [Integer] project The ID of a project. @param [Integer] snippet The ID of a snippet. @param [String] body The body of a note. @return [Gitlab::ObjectifiedHash] Information about created note.

# File lib/gitlab/client/notes.rb, line 145
def create_snippet_note(project, snippet, body)
  post("/projects/#{project}/snippets/#{snippet}/notes", body: { body: body })
end
issue_note(project, issue, id) click to toggle source

Gets a single issue note.

@example

Gitlab.issue_note(5, 10, 1)

@param [Integer] project The ID of a project. @param [Integer] issue The ID of an issue. @param [Integer] id The ID of a note. @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/notes.rb, line 81
def issue_note(project, issue, id)
  get("/projects/#{project}/issues/#{issue}/notes/#{id}")
end
issue_notes(project, issue, options={}) click to toggle source

Gets a list of notes for a issue.

@example

Gitlab.issue_notes(5, 10)

@param [Integer] project The ID of a project. @param [Integer] issue The ID of an issue. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/notes.rb, line 28
def issue_notes(project, issue, options={})
  get("/projects/#{project}/issues/#{issue}/notes", query: options)
end
merge_request_note(project, merge_request, id) click to toggle source

Gets a single merge_request note.

@example

Gitlab.merge_request_note(5, 11, 3)

@param [Integer] project The ID of a project. @param [Integer] merge_request The ID of a merge_request. @param [Integer] id The ID of a note. @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/notes.rb, line 107
def merge_request_note(project, merge_request, id)
  get("/projects/#{project}/merge_requests/#{merge_request}/notes/#{id}")
end
merge_request_notes(project, merge_request, options={}) click to toggle source

Gets a list of notes for a merge request.

@example

Gitlab.merge_request_notes(5, 1)

@param [Integer] project The ID of a project. @param [Integer] merge_request The ID of a merge request. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/notes.rb, line 56
def merge_request_notes(project, merge_request, options={})
  get("/projects/#{project}/merge_requests/#{merge_request}/notes", query: options)
end
note(project, id) click to toggle source

Gets a single wall note.

@example

Gitlab.note(5, 15)

@param [Integer] project The ID of a project. @param [Integer] id The ID of a note. @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/notes.rb, line 68
def note(project, id)
  get("/projects/#{project}/notes/#{id}")
end
notes(project, options={}) click to toggle source

Gets a list of projects notes.

@example

Gitlab.notes(5)

@param [Integer] project The ID of a project. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/notes.rb, line 14
def notes(project, options={})
  get("/projects/#{project}/notes", query: options)
end
snippet_note(project, snippet, id) click to toggle source

Gets a single snippet note.

@example

Gitlab.snippet_note(5, 11, 3)

@param [Integer] project The ID of a project. @param [Integer] snippet The ID of a snippet. @param [Integer] id The ID of a note. @return [Gitlab::ObjectifiedHash]

# File lib/gitlab/client/notes.rb, line 94
def snippet_note(project, snippet, id)
  get("/projects/#{project}/snippets/#{snippet}/notes/#{id}")
end
snippet_notes(project, snippet, options={}) click to toggle source

Gets a list of notes for a snippet.

@example

Gitlab.snippet_notes(5, 1)

@param [Integer] project The ID of a project. @param [Integer] snippet The ID of a snippet. @option options [Integer] :page The page number. @option options [Integer] :per_page The number of results per page. @return [Array<Gitlab::ObjectifiedHash>]

# File lib/gitlab/client/notes.rb, line 42
def snippet_notes(project, snippet, options={})
  get("/projects/#{project}/snippets/#{snippet}/notes", query: options)
end