Module: Gitlab::Client::Notes

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

Overview

Defines methods related to notes.

Instance Method Summary collapse

Instance Method Details

#create_issue_note(project, issue, body) ⇒ Gitlab::ObjectifiedHash

Creates a new issue note.

Parameters:

  • project (Integer)

    The ID of a project.

  • issue (Integer)

    The ID of an issue.

  • body (String)

    The body of a note.

Returns:



92
93
94
# File 'lib/gitlab/client/notes.rb', line 92

def create_issue_note(project, issue, body)
  post("/projects/#{project}/issues/#{issue}/notes", :body => {:body => body})
end

#create_note(project, body) ⇒ Gitlab::ObjectifiedHash

Creates a new wall note.

Parameters:

  • project (Integer)

    The ID of a project.

  • body (String)

    The body of a note.

Returns:



82
83
84
# File 'lib/gitlab/client/notes.rb', line 82

def create_note(project, body)
  post("/projects/#{project}/notes", :body => {:body => body})
end

#create_snippet_note(project, snippet, body) ⇒ Gitlab::ObjectifiedHash

Creates a new snippet note.

Parameters:

  • project (Integer)

    The ID of a project.

  • snippet (Integer)

    The ID of a snippet.

  • body (String)

    The body of a note.

Returns:



102
103
104
# File 'lib/gitlab/client/notes.rb', line 102

def create_snippet_note(project, snippet, body)
  post("/projects/#{project}/snippets/#{snippet}/notes", :body => {:body => body})
end

#issue_note(project, issue, id) ⇒ Gitlab::ObjectifiedHash

Gets a single issue note.

Examples:

Gitlab.issue_note(5, 10, 1)

Parameters:

  • project (Integer)

    The ID of a project.

  • issue (Integer)

    The ID of an issue.

  • id (Integer)

    The ID of a note.

Returns:



60
61
62
# File 'lib/gitlab/client/notes.rb', line 60

def issue_note(project, issue, id)
  get("/projects/#{project}/issues/#{issue}/notes/#{id}")
end

#issue_notes(project, issue) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of notes for a issue.

Examples:

Gitlab.issue_notes(5, 10)

Parameters:

  • project (Integer)

    The ID of a project.

  • issue (Integer)

    The ID of an issue.

Returns:



23
24
25
# File 'lib/gitlab/client/notes.rb', line 23

def issue_notes(project, issue)
  get("/projects/#{project}/issues/#{issue}/notes")
end

#note(project, id) ⇒ Gitlab::ObjectifiedHash

Gets a single wall note.

Examples:

Gitlab.note(5, 15)

Parameters:

  • project (Integer)

    The ID of a project.

  • id (Integer)

    The ID of a note.

Returns:



47
48
49
# File 'lib/gitlab/client/notes.rb', line 47

def note(project, id)
  get("/projects/#{project}/notes/#{id}")
end

#notes(project) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of projects notes.

Examples:

Gitlab.notes(5)

Parameters:

  • project (Integer)

    The ID of a project.

Returns:



11
12
13
# File 'lib/gitlab/client/notes.rb', line 11

def notes(project)
  get("/projects/#{project}/notes")
end

#snippet_note(project, snippet, id) ⇒ Gitlab::ObjectifiedHash

Gets a single snippet note.

Examples:

Gitlab.snippet_note(5, 11, 3)

Parameters:

  • project (Integer)

    The ID of a project.

  • snippet (Integer)

    The ID of a snippet.

  • id (Integer)

    The ID of an note.

Returns:



73
74
75
# File 'lib/gitlab/client/notes.rb', line 73

def snippet_note(project, snippet, id)
  get("/projects/#{project}/snippets/#{snippet}/notes/#{id}")
end

#snippet_notes(project, snippet) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of notes for a snippet.

Examples:

Gitlab.snippet_notes(5, 1)

Parameters:

  • project (Integer)

    The ID of a project.

  • snippet (Integer)

    The ID of a snippet.

Returns:



35
36
37
# File 'lib/gitlab/client/notes.rb', line 35

def snippet_notes(project, snippet)
  get("/projects/#{project}/snippets/#{snippet}/notes")
end