summaryrefslogtreecommitdiff
path: root/docs/gl_objects/notes.rst
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-03-28 08:14:28 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2018-03-28 08:15:00 +0200
commitf980707d5452d1f73f517bbaf91f1a0c045c2172 (patch)
tree37f396ac9b141a4becd3003feb5c41708cd17ebb /docs/gl_objects/notes.rst
parentf09089b9bcf8be0b90de62e33dd9797004790204 (diff)
downloadgitlab-f980707d5452d1f73f517bbaf91f1a0c045c2172.tar.gz
[docs] Move notes examples in their own file
Fixes #472
Diffstat (limited to 'docs/gl_objects/notes.rst')
-rw-r--r--docs/gl_objects/notes.rst89
1 files changed, 89 insertions, 0 deletions
diff --git a/docs/gl_objects/notes.rst b/docs/gl_objects/notes.rst
new file mode 100644
index 0000000..fd0788b
--- /dev/null
+++ b/docs/gl_objects/notes.rst
@@ -0,0 +1,89 @@
+.. _project-notes:
+
+#####
+Notes
+#####
+
+You can manipulate notes (comments) on project issues, merge requests and
+snippets.
+
+Reference
+---------
+
+* v4 API:
+
+ Issues:
+
+ + :class:`gitlab.v4.objects.ProjectIssueNote`
+ + :class:`gitlab.v4.objects.ProjectIssueNoteManager`
+ + :attr:`gitlab.v4.objects.ProjectIssue.notes`
+
+ MergeRequests:
+
+ + :class:`gitlab.v4.objects.ProjectMergeRequestNote`
+ + :class:`gitlab.v4.objects.ProjectMergeRequestNoteManager`
+ + :attr:`gitlab.v4.objects.ProjectMergeRequest.notes`
+
+ Snippets:
+
+ + :class:`gitlab.v4.objects.ProjectSnippetNote`
+ + :class:`gitlab.v4.objects.ProjectSnippetNoteManager`
+ + :attr:`gitlab.v4.objects.ProjectSnippet.notes`
+
+* v3 API:
+
+ Issues:
+
+ + :class:`gitlab.v3.objects.ProjectIssueNote`
+ + :class:`gitlab.v3.objects.ProjectIssueNoteManager`
+ + :attr:`gitlab.v3.objects.ProjectIssue.notes`
+ + :attr:`gitlab.v3.objects.Project.issue_notes`
+ + :attr:`gitlab.Gitlab.project_issue_notes`
+
+ MergeRequests:
+
+ + :class:`gitlab.v3.objects.ProjectMergeRequestNote`
+ + :class:`gitlab.v3.objects.ProjectMergeRequestNoteManager`
+ + :attr:`gitlab.v3.objects.ProjectMergeRequest.notes`
+ + :attr:`gitlab.v3.objects.Project.mergerequest_notes`
+ + :attr:`gitlab.Gitlab.project_mergerequest_notes`
+
+ Snippets:
+
+ + :class:`gitlab.v3.objects.ProjectSnippetNote`
+ + :class:`gitlab.v3.objects.ProjectSnippetNoteManager`
+ + :attr:`gitlab.v3.objects.ProjectSnippet.notes`
+ + :attr:`gitlab.v3.objects.Project.snippet_notes`
+ + :attr:`gitlab.Gitlab.project_snippet_notes`
+
+* GitLab API: https://docs.gitlab.com/ce/api/notes.html
+
+Examples
+--------
+
+List the notes for a resource::
+
+ i_notes = issue.notes.list()
+ mr_notes = mr.notes.list()
+ s_notes = snippet.notes.list()
+
+Get a note for a resource::
+
+ i_note = issue.notes.get(note_id)
+ mr_note = mr.notes.get(note_id)
+ s_note = snippet.notes.get(note_id)
+
+Create a note for a resource::
+
+ i_note = issue.notes.create({'body': 'note content'})
+ mr_note = mr.notes.create({'body': 'note content'})
+ s_note = snippet.notes.create({'body': 'note content'})
+
+Update a note for a resource::
+
+ note.body = 'updated note content'
+ note.save()
+
+Delete a note for a resource::
+
+ note.delete()