Skip to content
This repository was archived by the owner on Dec 10, 2024. It is now read-only.

Commit f81ec4e

Browse files
committed
Just a few minor style tweaks
1 parent 8c9df79 commit f81ec4e

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

draft_notes.go

+20-14
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,17 @@ type DraftNote struct {
3636
// DraftNotesService handles communication with the draft notes related methods
3737
// of the GitLab API.
3838
//
39-
// GitLab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#list-all-merge-request-draft-notes
39+
// GitLab API docs:
40+
// https://docs.gitlab.com/ee/api/draft_notes.html#list-all-merge-request-draft-notes
4041
type DraftNotesService struct {
4142
client *Client
4243
}
4344

4445
// ListDraftNotesOptions represents the available ListDraftNotes()
4546
// options.
4647
//
47-
// GitLab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#list-all-merge-request-draft-notes
48+
// GitLab API docs:
49+
// https://docs.gitlab.com/ee/api/draft_notes.html#list-all-merge-request-draft-notes
4850
type ListDraftNotesOptions struct {
4951
ListOptions
5052
OrderBy *string `url:"order_by,omitempty" json:"order_by,omitempty"`
@@ -53,13 +55,13 @@ type ListDraftNotesOptions struct {
5355

5456
// ListDraftNotes gets a list of all draft notes for a merge request.
5557
//
56-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#list-all-merge-request-draft-notes
58+
// Gitlab API docs:
59+
// https://docs.gitlab.com/ee/api/draft_notes.html#list-all-merge-request-draft-notes
5760
func (s *DraftNotesService) ListDraftNotes(pid interface{}, mergeRequest int, opt *ListDraftNotesOptions, options ...RequestOptionFunc) ([]*DraftNote, *Response, error) {
5861
project, err := parseID(pid)
5962
if err != nil {
6063
return nil, nil, err
6164
}
62-
6365
u := fmt.Sprintf("projects/%s/merge_requests/%d/draft_notes", PathEscape(project), mergeRequest)
6466

6567
req, err := s.client.NewRequest(http.MethodGet, u, opt, options)
@@ -78,7 +80,8 @@ func (s *DraftNotesService) ListDraftNotes(pid interface{}, mergeRequest int, op
7880

7981
// GetDraftNote gets a single draft note for a merge request.
8082
//
81-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#get-a-single-draft-note
83+
// Gitlab API docs:
84+
// https://docs.gitlab.com/ee/api/draft_notes.html#get-a-single-draft-note
8285
func (s *DraftNotesService) GetDraftNote(pid interface{}, mergeRequest int, note int, options ...RequestOptionFunc) (*DraftNote, *Response, error) {
8386
project, err := parseID(pid)
8487
if err != nil {
@@ -103,7 +106,8 @@ func (s *DraftNotesService) GetDraftNote(pid interface{}, mergeRequest int, note
103106
// CreateDraftNoteOptions represents the available CreateDraftNote()
104107
// options.
105108
//
106-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#create-a-draft-note
109+
// Gitlab API docs:
110+
// https://docs.gitlab.com/ee/api/draft_notes.html#create-a-draft-note
107111
type CreateDraftNoteOptions struct {
108112
Note *string `url:"note" json:"note"`
109113
CommitID *string `url:"commit_id,omitempty" json:"commit_id,omitempty"`
@@ -114,13 +118,13 @@ type CreateDraftNoteOptions struct {
114118

115119
// CreateDraftNote creates a draft note for a merge request.
116120
//
117-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#create-a-draft-note
121+
// Gitlab API docs:
122+
// https://docs.gitlab.com/ee/api/draft_notes.html#create-a-draft-note
118123
func (s *DraftNotesService) CreateDraftNote(pid interface{}, mergeRequest int, opt *CreateDraftNoteOptions, options ...RequestOptionFunc) (*DraftNote, *Response, error) {
119124
project, err := parseID(pid)
120125
if err != nil {
121126
return nil, nil, err
122127
}
123-
124128
u := fmt.Sprintf("projects/%s/merge_requests/%d/draft_notes", PathEscape(project), mergeRequest)
125129

126130
req, err := s.client.NewRequest(http.MethodPost, u, opt, options)
@@ -140,7 +144,8 @@ func (s *DraftNotesService) CreateDraftNote(pid interface{}, mergeRequest int, o
140144
// UpdateDraftNoteOptions represents the available UpdateDraftNote()
141145
// options.
142146
//
143-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#create-a-draft-note
147+
// Gitlab API docs:
148+
// https://docs.gitlab.com/ee/api/draft_notes.html#create-a-draft-note
144149
type UpdateDraftNoteOptions struct {
145150
Note *string `url:"note,omitempty" json:"note,omitempty"`
146151
Position *PositionOptions `url:"position,omitempty" json:"position,omitempty"`
@@ -154,7 +159,6 @@ func (s *DraftNotesService) UpdateDraftNote(pid interface{}, mergeRequest int, n
154159
if err != nil {
155160
return nil, nil, err
156161
}
157-
158162
u := fmt.Sprintf("projects/%s/merge_requests/%d/draft_notes/%d", PathEscape(project), mergeRequest, note)
159163

160164
req, err := s.client.NewRequest(http.MethodPut, u, opt, options)
@@ -173,7 +177,8 @@ func (s *DraftNotesService) UpdateDraftNote(pid interface{}, mergeRequest int, n
173177

174178
// DeleteDraftNote deletes a single draft note for a merge request.
175179
//
176-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#delete-a-draft-note
180+
// Gitlab API docs:
181+
// https://docs.gitlab.com/ee/api/draft_notes.html#delete-a-draft-note
177182
func (s *DraftNotesService) DeleteDraftNote(pid interface{}, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) {
178183
project, err := parseID(pid)
179184
if err != nil {
@@ -191,7 +196,8 @@ func (s *DraftNotesService) DeleteDraftNote(pid interface{}, mergeRequest int, n
191196

192197
// PublishDraftNote publishes a single draft note for a merge request.
193198
//
194-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#publish-a-draft-note
199+
// Gitlab API docs:
200+
// https://docs.gitlab.com/ee/api/draft_notes.html#publish-a-draft-note
195201
func (s *DraftNotesService) PublishDraftNote(pid interface{}, mergeRequest int, note int, options ...RequestOptionFunc) (*Response, error) {
196202
project, err := parseID(pid)
197203
if err != nil {
@@ -209,13 +215,13 @@ func (s *DraftNotesService) PublishDraftNote(pid interface{}, mergeRequest int,
209215

210216
// PublishAllDraftNotes publishes all draft notes for a merge request that belong to the user.
211217
//
212-
// Gitlab API docs: https://docs.gitlab.com/ee/api/draft_notes.html#publish-a-draft-note
218+
// Gitlab API docs:
219+
// https://docs.gitlab.com/ee/api/draft_notes.html#publish-a-draft-note
213220
func (s *DraftNotesService) PublishAllDraftNotes(pid interface{}, mergeRequest int, options ...RequestOptionFunc) (*Response, error) {
214221
project, err := parseID(pid)
215222
if err != nil {
216223
return nil, err
217224
}
218-
219225
u := fmt.Sprintf("projects/%s/merge_requests/%d/draft_notes/bulk_publish", PathEscape(project), mergeRequest)
220226

221227
req, err := s.client.NewRequest(http.MethodPost, u, nil, options)

0 commit comments

Comments
 (0)