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:



99
100
101
# File 'lib/gitlab/client/notes.rb', line 99

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) ⇒ Object

Creates a new note for a single merge request.

Parameters:

  • project (Integer)

    The ID of a project.

  • merge_request (Integer)

    The ID of a merge request.

  • body (String)

    The content of a note.



118
119
120
# File 'lib/gitlab/client/notes.rb', line 118

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) ⇒ Gitlab::ObjectifiedHash

Creates a new wall note.

Parameters:

  • project (Integer)

    The ID of a project.

  • body (String)

    The body of a note.

Returns:



89
90
91
# File 'lib/gitlab/client/notes.rb', line 89

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:



109
110
111
# File 'lib/gitlab/client/notes.rb', line 109

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:



67
68
69
# File 'lib/gitlab/client/notes.rb', line 67

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

#issue_notes(project, issue, options = {}) ⇒ 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.

  • 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:



28
29
30
# File 'lib/gitlab/client/notes.rb', line 28

def issue_notes(project, issue, options={})
  get("/projects/#{project}/issues/#{issue}/notes", :query => options)
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:



54
55
56
# File 'lib/gitlab/client/notes.rb', line 54

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

#notes(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of projects notes.

Examples:

Gitlab.notes(5)

Parameters:

  • project (Integer)

    The ID of a project.

  • 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:



14
15
16
# File 'lib/gitlab/client/notes.rb', line 14

def notes(project, options={})
  get("/projects/#{project}/notes", :query => options)
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:



80
81
82
# File 'lib/gitlab/client/notes.rb', line 80

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

#snippet_notes(project, snippet, options = {}) ⇒ 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.

  • 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:



42
43
44
# File 'lib/gitlab/client/notes.rb', line 42

def snippet_notes(project, snippet, options={})
  get("/projects/#{project}/snippets/#{snippet}/notes", :query => options)
end