gitlab 4.6.0 → 4.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gitlab/client/access_requests.rb +92 -90
- data/lib/gitlab/client/award_emojis.rb +126 -124
- data/lib/gitlab/client/boards.rb +81 -79
- data/lib/gitlab/client/branches.rb +89 -87
- data/lib/gitlab/client/build_variables.rb +117 -115
- data/lib/gitlab/client/builds.rb +98 -96
- data/lib/gitlab/client/commits.rb +154 -152
- data/lib/gitlab/client/deployments.rb +29 -27
- data/lib/gitlab/client/environments.rb +80 -78
- data/lib/gitlab/client/events.rb +54 -52
- data/lib/gitlab/client/group_milestones.rb +85 -83
- data/lib/gitlab/client/groups.rb +178 -176
- data/lib/gitlab/client/issues.rb +190 -188
- data/lib/gitlab/client/jobs.rb +150 -148
- data/lib/gitlab/client/keys.rb +14 -12
- data/lib/gitlab/client/labels.rb +79 -77
- data/lib/gitlab/client/merge_request_approvals.rb +101 -99
- data/lib/gitlab/client/merge_requests.rb +279 -277
- data/lib/gitlab/client/milestones.rb +85 -83
- data/lib/gitlab/client/namespaces.rb +18 -16
- data/lib/gitlab/client/notes.rb +260 -258
- data/lib/gitlab/client/pipeline_schedules.rb +123 -121
- data/lib/gitlab/client/pipeline_triggers.rb +93 -91
- data/lib/gitlab/client/pipelines.rb +62 -60
- data/lib/gitlab/client/projects.rb +526 -524
- data/lib/gitlab/client/repositories.rb +67 -65
- data/lib/gitlab/client/repository_files.rb +103 -101
- data/lib/gitlab/client/runners.rb +114 -112
- data/lib/gitlab/client/services.rb +45 -43
- data/lib/gitlab/client/sidekiq.rb +32 -30
- data/lib/gitlab/client/snippets.rb +86 -84
- data/lib/gitlab/client/system_hooks.rb +57 -55
- data/lib/gitlab/client/tags.rb +88 -86
- data/lib/gitlab/client/todos.rb +40 -38
- data/lib/gitlab/client/users.rb +243 -241
- data/lib/gitlab/client/versions.rb +13 -11
- data/lib/gitlab/help.rb +1 -1
- data/lib/gitlab/version.rb +1 -1
- metadata +1 -1
@@ -1,92 +1,94 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to milestones.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/milestones.html
|
6
|
+
module Milestones
|
7
|
+
# Gets a list of project's milestones.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.milestones(5)
|
11
|
+
#
|
12
|
+
# @param [Integer, String] project The ID or name of a project.
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @option options [Integer] :page The page number.
|
15
|
+
# @option options [Integer] :per_page The number of results per page.
|
16
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
17
|
+
def milestones(project, options = {})
|
18
|
+
get("/projects/#{url_encode project}/milestones", query: options)
|
19
|
+
end
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
# Gets a single milestone.
|
22
|
+
#
|
23
|
+
# @example
|
24
|
+
# Gitlab.milestone(5, 36)
|
25
|
+
#
|
26
|
+
# @param [Integer, String] project The ID or name of a project.
|
27
|
+
# @param [Integer] id The ID of a milestone.
|
28
|
+
# @return [Gitlab::ObjectifiedHash]
|
29
|
+
def milestone(project, id)
|
30
|
+
get("/projects/#{url_encode project}/milestones/#{id}")
|
31
|
+
end
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
33
|
+
# Gets the issues of a given milestone.
|
34
|
+
#
|
35
|
+
# @example
|
36
|
+
# Gitlab.milestone_issues(5, 2)
|
37
|
+
#
|
38
|
+
# @param [Integer, String] project The ID or name of a project.
|
39
|
+
# @param [Integer, String] milestone The ID of a milestone.
|
40
|
+
# @option options [Integer] :page The page number.
|
41
|
+
# @option options [Integer] :per_page The number of results per page.
|
42
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
43
|
+
def milestone_issues(project, milestone, options = {})
|
44
|
+
get("/projects/#{url_encode project}/milestones/#{milestone}/issues", query: options)
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
47
|
+
# Gets the merge_requests of a given milestone.
|
48
|
+
#
|
49
|
+
# @example
|
50
|
+
# Gitlab.milestone_merge_requests(5, 2)
|
51
|
+
#
|
52
|
+
# @param [Integer, String] project The ID or name of a project.
|
53
|
+
# @param [Integer, String] milestone The ID of a milestone.
|
54
|
+
# @option options [Integer] :page The page number.
|
55
|
+
# @option options [Integer] :per_page The number of results per page.
|
56
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
57
|
+
def milestone_merge_requests(project, milestone, options = {})
|
58
|
+
get("/projects/#{url_encode project}/milestones/#{milestone}/merge_requests", query: options)
|
59
|
+
end
|
59
60
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
61
|
+
# Creates a new milestone.
|
62
|
+
#
|
63
|
+
# @example
|
64
|
+
# Gitlab.create_milestone(5, 'v1.0')
|
65
|
+
#
|
66
|
+
# @param [Integer, String] project The ID or name of a project.
|
67
|
+
# @param [String] title The title of a milestone.
|
68
|
+
# @param [Hash] options A customizable set of options.
|
69
|
+
# @option options [String] :description The description of a milestone.
|
70
|
+
# @option options [String] :due_date The due date of a milestone.
|
71
|
+
# @return [Gitlab::ObjectifiedHash] Information about created milestone.
|
72
|
+
def create_milestone(project, title, options = {})
|
73
|
+
body = { title: title }.merge(options)
|
74
|
+
post("/projects/#{url_encode project}/milestones", body: body)
|
75
|
+
end
|
75
76
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
77
|
+
# Updates a milestone.
|
78
|
+
#
|
79
|
+
# @example
|
80
|
+
# Gitlab.edit_milestone(5, 2, { state_event: 'activate' })
|
81
|
+
#
|
82
|
+
# @param [Integer, String] project The ID or name of a project.
|
83
|
+
# @param [Integer] id The ID of a milestone.
|
84
|
+
# @param [Hash] options A customizable set of options.
|
85
|
+
# @option options [String] :title The title of a milestone.
|
86
|
+
# @option options [String] :description The description of a milestone.
|
87
|
+
# @option options [String] :due_date The due date of a milestone.
|
88
|
+
# @option options [String] :state_event The state of a milestone ('close' or 'activate').
|
89
|
+
# @return [Gitlab::ObjectifiedHash] Information about updated milestone.
|
90
|
+
def edit_milestone(project, id, options = {})
|
91
|
+
put("/projects/#{url_encode project}/milestones/#{id}", body: options)
|
92
|
+
end
|
91
93
|
end
|
92
94
|
end
|
@@ -1,20 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to namespaces
|
5
|
+
# @see https://docs.gitlab.com/ce/api/namespaces.html
|
6
|
+
module Namespaces
|
7
|
+
# Gets a list of namespaces.
|
8
|
+
# @see https://docs.gitlab.com/ce/api/namespaces.html#list-namespaces
|
9
|
+
#
|
10
|
+
# @example
|
11
|
+
# Gitlab.namespaces
|
12
|
+
#
|
13
|
+
# @param [Hash] options A customizable set of options.
|
14
|
+
# @options options [Integer] :page The page number.
|
15
|
+
# @options options [Integer] :per_page The number of results per page.
|
16
|
+
# @options opttion [String] :search The string to search for.
|
17
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
18
|
+
def namespaces(options = {})
|
19
|
+
get('/namespaces', query: options)
|
20
|
+
end
|
19
21
|
end
|
20
22
|
end
|
data/lib/gitlab/client/notes.rb
CHANGED
@@ -1,284 +1,286 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
3
|
+
class Gitlab::Client
|
4
|
+
# Defines methods related to notes.
|
5
|
+
# @see https://docs.gitlab.com/ce/api/notes.html
|
6
|
+
module Notes
|
7
|
+
# Gets a list of projects notes.
|
8
|
+
#
|
9
|
+
# @example
|
10
|
+
# Gitlab.notes(5)
|
11
|
+
#
|
12
|
+
# @param [Integer] project The ID of a project.
|
13
|
+
# @option options [Integer] :page The page number.
|
14
|
+
# @option options [Integer] :per_page The number of results per page.
|
15
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
16
|
+
def notes(project, options = {})
|
17
|
+
get("/projects/#{url_encode project}/notes", query: options)
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
20
|
+
# Gets a list of notes for a issue.
|
21
|
+
#
|
22
|
+
# @example
|
23
|
+
# Gitlab.issue_notes(5, 10)
|
24
|
+
#
|
25
|
+
# @param [Integer] project The ID of a project.
|
26
|
+
# @param [Integer] issue The ID of an issue.
|
27
|
+
# @option options [Integer] :page The page number.
|
28
|
+
# @option options [Integer] :per_page The number of results per page.
|
29
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
30
|
+
def issue_notes(project, issue, options = {})
|
31
|
+
get("/projects/#{url_encode project}/issues/#{issue}/notes", query: options)
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
34
|
+
# Gets a list of notes for a snippet.
|
35
|
+
#
|
36
|
+
# @example
|
37
|
+
# Gitlab.snippet_notes(5, 1)
|
38
|
+
#
|
39
|
+
# @param [Integer] project The ID of a project.
|
40
|
+
# @param [Integer] snippet The ID of a snippet.
|
41
|
+
# @option options [Integer] :page The page number.
|
42
|
+
# @option options [Integer] :per_page The number of results per page.
|
43
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
44
|
+
def snippet_notes(project, snippet, options = {})
|
45
|
+
get("/projects/#{url_encode project}/snippets/#{snippet}/notes", query: options)
|
46
|
+
end
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
# Gets a list of notes for a merge request.
|
49
|
+
#
|
50
|
+
# @example
|
51
|
+
# Gitlab.merge_request_notes(5, 1)
|
52
|
+
#
|
53
|
+
# @param [Integer] project The ID of a project.
|
54
|
+
# @param [Integer] merge_request The ID of a merge request.
|
55
|
+
# @option options [Integer] :page The page number.
|
56
|
+
# @option options [Integer] :per_page The number of results per page.
|
57
|
+
# @return [Array<Gitlab::ObjectifiedHash>]
|
58
|
+
def merge_request_notes(project, merge_request, options = {})
|
59
|
+
get("/projects/#{url_encode project}/merge_requests/#{merge_request}/notes", query: options)
|
60
|
+
end
|
61
|
+
alias merge_request_comments merge_request_notes
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
63
|
+
# Gets a single wall note.
|
64
|
+
#
|
65
|
+
# @example
|
66
|
+
# Gitlab.note(5, 15)
|
67
|
+
#
|
68
|
+
# @param [Integer] project The ID of a project.
|
69
|
+
# @param [Integer] id The ID of a note.
|
70
|
+
# @return [Gitlab::ObjectifiedHash]
|
71
|
+
def note(project, id)
|
72
|
+
get("/projects/#{url_encode project}/notes/#{id}")
|
73
|
+
end
|
73
74
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
75
|
+
# Gets a single issue note.
|
76
|
+
#
|
77
|
+
# @example
|
78
|
+
# Gitlab.issue_note(5, 10, 1)
|
79
|
+
#
|
80
|
+
# @param [Integer] project The ID of a project.
|
81
|
+
# @param [Integer] issue The ID of an issue.
|
82
|
+
# @param [Integer] id The ID of a note.
|
83
|
+
# @return [Gitlab::ObjectifiedHash]
|
84
|
+
def issue_note(project, issue, id)
|
85
|
+
get("/projects/#{url_encode project}/issues/#{issue}/notes/#{id}")
|
86
|
+
end
|
86
87
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
88
|
+
# Gets a single snippet note.
|
89
|
+
#
|
90
|
+
# @example
|
91
|
+
# Gitlab.snippet_note(5, 11, 3)
|
92
|
+
#
|
93
|
+
# @param [Integer] project The ID of a project.
|
94
|
+
# @param [Integer] snippet The ID of a snippet.
|
95
|
+
# @param [Integer] id The ID of a note.
|
96
|
+
# @return [Gitlab::ObjectifiedHash]
|
97
|
+
def snippet_note(project, snippet, id)
|
98
|
+
get("/projects/#{url_encode project}/snippets/#{snippet}/notes/#{id}")
|
99
|
+
end
|
99
100
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
101
|
+
# Gets a single merge_request note.
|
102
|
+
#
|
103
|
+
# @example
|
104
|
+
# Gitlab.merge_request_note(5, 11, 3)
|
105
|
+
#
|
106
|
+
# @param [Integer] project The ID of a project.
|
107
|
+
# @param [Integer] merge_request The ID of a merge_request.
|
108
|
+
# @param [Integer] id The ID of a note.
|
109
|
+
# @return [Gitlab::ObjectifiedHash]
|
110
|
+
def merge_request_note(project, merge_request, id)
|
111
|
+
get("/projects/#{url_encode project}/merge_requests/#{merge_request}/notes/#{id}")
|
112
|
+
end
|
112
113
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
114
|
+
# Creates a new wall note.
|
115
|
+
#
|
116
|
+
# @example
|
117
|
+
# Gitlab.create_note(5, 'This is a wall note!')
|
118
|
+
#
|
119
|
+
# @param [Integer, String] project The ID or name of a project.
|
120
|
+
# @param [String] body The body of a note.
|
121
|
+
# @return [Gitlab::ObjectifiedHash] Information about created note.
|
122
|
+
def create_note(project, body)
|
123
|
+
post("/projects/#{url_encode project}/notes", body: { body: body })
|
124
|
+
end
|
124
125
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
126
|
+
# Creates a new issue note.
|
127
|
+
#
|
128
|
+
# @example
|
129
|
+
# Gitlab.create_issue_note(6, 1, 'Adding a note to my issue.')
|
130
|
+
#
|
131
|
+
# @param [Integer, String] project The ID or name of a project.
|
132
|
+
# @param [Integer] issue The ID of an issue.
|
133
|
+
# @param [String] body The body of a note.
|
134
|
+
# @return [Gitlab::ObjectifiedHash] Information about created note.
|
135
|
+
def create_issue_note(project, issue, body)
|
136
|
+
post("/projects/#{url_encode project}/issues/#{issue}/notes", body: { body: body })
|
137
|
+
end
|
137
138
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
139
|
+
# Creates a new snippet note.
|
140
|
+
#
|
141
|
+
# @example
|
142
|
+
# Gitlab.create_snippet_note(3, 2, 'Look at this awesome snippet!')
|
143
|
+
#
|
144
|
+
# @param [Integer, String] project The ID or name of a project.
|
145
|
+
# @param [Integer] snippet The ID of a snippet.
|
146
|
+
# @param [String] body The body of a note.
|
147
|
+
# @return [Gitlab::ObjectifiedHash] Information about created note.
|
148
|
+
def create_snippet_note(project, snippet, body)
|
149
|
+
post("/projects/#{url_encode project}/snippets/#{snippet}/notes", body: { body: body })
|
150
|
+
end
|
150
151
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
152
|
+
# Creates a new note for a single merge request.
|
153
|
+
#
|
154
|
+
# @example
|
155
|
+
# Gitlab.create_merge_request_note(5, 3, 'This MR is ready for review.')
|
156
|
+
#
|
157
|
+
# @param [Integer] project The ID of a project.
|
158
|
+
# @param [Integer] merge_request The ID of a merge request.
|
159
|
+
# @param [String] body The content of a note.
|
160
|
+
def create_merge_request_note(project, merge_request, body)
|
161
|
+
post("/projects/#{url_encode project}/merge_requests/#{merge_request}/notes", body: { body: body })
|
162
|
+
end
|
163
|
+
alias create_merge_request_comment create_merge_request_note
|
163
164
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
165
|
+
# Deletes a wall note.
|
166
|
+
#
|
167
|
+
# @example
|
168
|
+
# Gitlab.delete_note(5, 15)
|
169
|
+
#
|
170
|
+
# @param [Integer] project The ID of a project.
|
171
|
+
# @param [Integer] id The ID of a note.
|
172
|
+
# @return [Gitlab::ObjectifiedHash]
|
173
|
+
def delete_note(project, id)
|
174
|
+
delete("/projects/#{url_encode project}/notes/#{id}")
|
175
|
+
end
|
175
176
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
177
|
+
# Deletes an issue note.
|
178
|
+
#
|
179
|
+
# @example
|
180
|
+
# Gitlab.delete_issue_note(5, 10, 1)
|
181
|
+
#
|
182
|
+
# @param [Integer] project The ID of a project.
|
183
|
+
# @param [Integer] issue The ID of an issue.
|
184
|
+
# @param [Integer] id The ID of a note.
|
185
|
+
# @return [Gitlab::ObjectifiedHash]
|
186
|
+
def delete_issue_note(project, issue, id)
|
187
|
+
delete("/projects/#{url_encode project}/issues/#{issue}/notes/#{id}")
|
188
|
+
end
|
188
189
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
190
|
+
# Deletes a snippet note.
|
191
|
+
#
|
192
|
+
# @example
|
193
|
+
# Gitlab.delete_snippet_note(5, 11, 3)
|
194
|
+
#
|
195
|
+
# @param [Integer] project The ID of a project.
|
196
|
+
# @param [Integer] snippet The ID of a snippet.
|
197
|
+
# @param [Integer] id The ID of a note.
|
198
|
+
# @return [Gitlab::ObjectifiedHash]
|
199
|
+
def delete_snippet_note(project, snippet, id)
|
200
|
+
delete("/projects/#{url_encode project}/snippets/#{snippet}/notes/#{id}")
|
201
|
+
end
|
201
202
|
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
203
|
+
# Deletes a merge_request note.
|
204
|
+
#
|
205
|
+
# @example
|
206
|
+
# Gitlab.delete_merge_request_note(5, 11, 3)
|
207
|
+
#
|
208
|
+
# @param [Integer] project The ID of a project.
|
209
|
+
# @param [Integer] merge_request The ID of a merge_request.
|
210
|
+
# @param [Integer] id The ID of a note.
|
211
|
+
# @return [Gitlab::ObjectifiedHash]
|
212
|
+
def delete_merge_request_note(project, merge_request, id)
|
213
|
+
delete("/projects/#{url_encode project}/merge_requests/#{merge_request}/notes/#{id}")
|
214
|
+
end
|
215
|
+
alias delete_merge_request_comment delete_merge_request_note
|
215
216
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
217
|
+
# Modifies a wall note.
|
218
|
+
#
|
219
|
+
# @example
|
220
|
+
# Gitlab.edit_note(5, 15, 'This is an edited note')
|
221
|
+
#
|
222
|
+
# @param [Integer] project The ID of a project.
|
223
|
+
# @param [Integer] id The ID of a note.
|
224
|
+
# @param [String] body The content of a note.
|
225
|
+
# @return [Gitlab::ObjectifiedHash]
|
226
|
+
def edit_note(project, id, body)
|
227
|
+
put("/projects/#{url_encode project}/notes/#{id}", body: note_content(body))
|
228
|
+
end
|
228
229
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
230
|
+
# Modifies an issue note.
|
231
|
+
#
|
232
|
+
# @example
|
233
|
+
# Gitlab.edit_issue_note(5, 10, 1, 'This is an edited issue note')
|
234
|
+
#
|
235
|
+
# @param [Integer] project The ID of a project.
|
236
|
+
# @param [Integer] issue The ID of an issue.
|
237
|
+
# @param [Integer] id The ID of a note.
|
238
|
+
# @param [String] body The content of a note.
|
239
|
+
# @return [Gitlab::ObjectifiedHash]
|
240
|
+
def edit_issue_note(project, issue, id, body)
|
241
|
+
put("/projects/#{url_encode project}/issues/#{issue}/notes/#{id}", body: note_content(body))
|
242
|
+
end
|
242
243
|
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
244
|
+
# Modifies a snippet note.
|
245
|
+
#
|
246
|
+
# @example
|
247
|
+
# Gitlab.edit_snippet_note(5, 11, 3, 'This is an edited snippet note')
|
248
|
+
#
|
249
|
+
# @param [Integer] project The ID of a project.
|
250
|
+
# @param [Integer] snippet The ID of a snippet.
|
251
|
+
# @param [Integer] id The ID of a note.
|
252
|
+
# @param [String] body The content of a note.
|
253
|
+
# @return [Gitlab::ObjectifiedHash]
|
254
|
+
def edit_snippet_note(project, snippet, id, body)
|
255
|
+
put("/projects/#{url_encode project}/snippets/#{snippet}/notes/#{id}", body: note_content(body))
|
256
|
+
end
|
256
257
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
258
|
+
# Modifies a merge_request note.
|
259
|
+
#
|
260
|
+
# @example
|
261
|
+
# Gitlab.edit_merge_request_note(5, 11, 3, 'This is an edited merge request note')
|
262
|
+
#
|
263
|
+
# @param [Integer] project The ID of a project.
|
264
|
+
# @param [Integer] merge_request The ID of a merge_request.
|
265
|
+
# @param [Integer] id The ID of a note.
|
266
|
+
# @param [String] body The content of a note.
|
267
|
+
# @return [Gitlab::ObjectifiedHash]
|
268
|
+
def edit_merge_request_note(project, merge_request, id, body)
|
269
|
+
put("/projects/#{url_encode project}/merge_requests/#{merge_request}/notes/#{id}", body: note_content(body))
|
270
|
+
end
|
271
|
+
alias edit_merge_request_comment edit_merge_request_note
|
271
272
|
|
272
|
-
|
273
|
+
private
|
273
274
|
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
275
|
+
# TODO: Remove this method after a couple deprecation cycles. Replace calls with the code
|
276
|
+
# in the 'else'.
|
277
|
+
def note_content(body)
|
278
|
+
if body.is_a?(Hash)
|
279
|
+
STDERR.puts 'Passing the note body as a Hash is deprecated. You should just pass the String.'
|
280
|
+
body
|
281
|
+
else
|
282
|
+
{ body: body }
|
283
|
+
end
|
282
284
|
end
|
283
285
|
end
|
284
286
|
end
|