aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/xanzy/go-gitlab/notes.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/notes.go')
-rw-r--r--vendor/github.com/xanzy/go-gitlab/notes.go38
1 files changed, 27 insertions, 11 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/notes.go b/vendor/github.com/xanzy/go-gitlab/notes.go
index b8e9f32..2ad7f9d 100644
--- a/vendor/github.com/xanzy/go-gitlab/notes.go
+++ b/vendor/github.com/xanzy/go-gitlab/notes.go
@@ -46,11 +46,16 @@ type Note struct {
Name string `json:"name"`
State string `json:"state"`
CreatedAt *time.Time `json:"created_at"`
+ AvatarURL string `json:"avatar_url"`
+ WebURL string `json:"web_url"`
} `json:"author"`
- System bool `json:"system"`
- ExpiresAt *time.Time `json:"expires_at"`
- UpdatedAt *time.Time `json:"updated_at"`
- CreatedAt *time.Time `json:"created_at"`
+ System bool `json:"system"`
+ ExpiresAt *time.Time `json:"expires_at"`
+ UpdatedAt *time.Time `json:"updated_at"`
+ CreatedAt *time.Time `json:"created_at"`
+ NoteableID int `json:"noteable_id"`
+ NoteableType string `json:"noteable_type"`
+ NoteableIID int `json:"noteable_iid"`
}
func (n Note) String() string {
@@ -61,9 +66,7 @@ func (n Note) String() string {
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#list-project-issue-notes
-type ListIssueNotesOptions struct {
- ListOptions
-}
+type ListIssueNotesOptions ListOptions
// ListIssueNotes gets a list of all notes for a single issue.
//
@@ -200,19 +203,25 @@ func (s *NotesService) DeleteIssueNote(pid interface{}, issue, note int, options
return s.client.Do(req, nil)
}
+// ListSnippetNotesOptions represents the available ListSnippetNotes() options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/notes.html#list-all-snippet-notes
+type ListSnippetNotesOptions ListOptions
+
// ListSnippetNotes gets a list of all notes for a single snippet. Snippet
// notes are comments users can post to a snippet.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#list-all-snippet-notes
-func (s *NotesService) ListSnippetNotes(pid interface{}, snippet int, options ...OptionFunc) ([]*Note, *Response, error) {
+func (s *NotesService) ListSnippetNotes(pid interface{}, snippet int, opt *ListSnippetNotesOptions, options ...OptionFunc) ([]*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/snippets/%d/notes", url.QueryEscape(project), snippet)
- req, err := s.client.NewRequest("GET", u, nil, options)
+ req, err := s.client.NewRequest("GET", u, opt, options)
if err != nil {
return nil, nil, err
}
@@ -337,18 +346,25 @@ func (s *NotesService) DeleteSnippetNote(pid interface{}, snippet, note int, opt
return s.client.Do(req, nil)
}
+// ListMergeRequestNotesOptions represents the available ListMergeRequestNotes()
+// options.
+//
+// GitLab API docs:
+// https://docs.gitlab.com/ce/api/notes.html#list-all-merge-request-notes
+type ListMergeRequestNotesOptions ListOptions
+
// ListMergeRequestNotes gets a list of all notes for a single merge request.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/notes.html#list-all-merge-request-notes
-func (s *NotesService) ListMergeRequestNotes(pid interface{}, mergeRequest int, options ...OptionFunc) ([]*Note, *Response, error) {
+func (s *NotesService) ListMergeRequestNotes(pid interface{}, mergeRequest int, opt *ListMergeRequestNotesOptions, options ...OptionFunc) ([]*Note, *Response, error) {
project, err := parseID(pid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("projects/%s/merge_requests/%d/notes", url.QueryEscape(project), mergeRequest)
- req, err := s.client.NewRequest("GET", u, nil, options)
+ req, err := s.client.NewRequest("GET", u, opt, options)
if err != nil {
return nil, nil, err
}